Explorar el Código

pre-commit: abort if changes unstaged

Fabian Peter Hammerle hace 4 años
padre
commit
3a1d4109c3
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      .githooks/pre-commit

+ 7 - 0
.githooks/pre-commit

@@ -1,5 +1,12 @@
 #!/bin/sh
 
+if ! git diff --quiet --exit-code; then
+    git status
+    echo
+    echo unstaged changes
+    exit 1
+fi
+
 set -ex
 
 pipenv clean