]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Update pre-commit hook
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 15 Oct 2013 12:21:19 +0000 (14:21 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 15 Oct 2013 12:21:19 +0000 (14:21 +0200)
contrib/hooks/pre-commit

index 42584808d68029a2bdfbf0c719ce3efe44f97b47..cba8d836b517b54cfae643a27410748c765ba7c4 100755 (executable)
@@ -7,5 +7,13 @@ set -e
 # Make README.md be always in sync with novaboot - work with objects
 # in the index (what is being committed), not with what is in the
 # working tree.
+git diff --quiet README.md
+README_clean=$?
+
 hash=$(git show :novaboot | pod2markdown | git hash-object -w --stdin)
 git update-index --cacheinfo 100644 $hash README.md
+
+if [ "$README_clean" = 0 ]; then
+    # Update the working tree copy
+    git checkout README.md
+fi