Last active
October 13, 2018 22:14
-
-
Save philgebhardt/8409008597d66d933767c9b2d8fda22f to your computer and use it in GitHub Desktop.
Git post-receive hook built for running `make check`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
set -x | |
WORKTREE= | |
GITDIR= | |
test -z $WORKTREE && exit 0 | |
test -z $GITDIR && exit 0 | |
while read oldrev newrev ref | |
do | |
branch=${ref#refs/heads/*} | |
git --work-tree=$WORKTREE --git-dir=$GITDIR checkout -f $branch \ | |
&& pushd $WORKTREE \ | |
&& make check \ | |
&& popd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment