]> git.phdru.name Git - git-scripts.git/blob - add-pubkey/post-checkout
Add scripts to put phd public key to an orphaned branch
[git-scripts.git] / add-pubkey / post-checkout
1 #!/bin/sh
2
3 # post-checkout hook that compiles python files to byte code
4 # if branch was changed or remove byte code files for a specific branch
5
6 prev_HEAD="$1"
7 new_HEAD="$2"
8 new_branch="$3"
9
10 if [ \( "$new_branch" = 1 \) ]; then
11    phd_pubkey_HEAD="`git show-ref --hash refs/heads/phd-pubkey`"
12    if [ "$new_HEAD" = "$phd_pubkey_HEAD" ]; then
13       git clean -d -f -q
14    else
15       python2.7 -m compileall -q . &&
16       python2.7 -O -m compileall -q .
17    fi
18 fi
19
20 exit 0