]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/bash | |
2 | ||
3 | # Copy me to .git/hooks/pre-commit | |
4 | ||
5 | set -e | |
6 | ||
7 | cleanup() { | |
8 | if [[ "$D" && -e "$D" ]];then | |
9 | rm -rf "$D" | |
10 | fi | |
11 | } | |
12 | trap cleanup EXIT | |
13 | ||
14 | D=$(mktemp -d) | |
15 | [[ "$D" && -d "$D" ]] | |
16 | ||
17 | git checkout-index --prefix="$D/" -a | |
18 | pushd "$D" | |
19 | ||
20 | ./test.sh | |
21 | ||
22 | popd |