]> rtime.felk.cvut.cz Git - novaboot.git/blob - contrib/hooks/pre-commit
7f4a498cce5b63706e11df6eeb21c8bff4a5a647
[novaboot.git] / contrib / hooks / pre-commit
1 #!/bin/sh
2
3 # git pre-commit hook
4
5 set -eo pipefail
6
7 # Make README.pod be always in sync with novaboot - work with objects
8 # in the index (what is being committed), not with what is in the
9 # working tree.
10 git diff --quiet README.pod
11 README_clean=$?
12
13 hash=$(git show :novaboot | podselect | git hash-object -w --stdin)
14 git update-index --cacheinfo 100644 $hash README.pod
15
16 if [ "$README_clean" = 0 ]; then
17     # Update the working tree copy
18     git checkout README.pod
19 fi