Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (20 sloc) 508 Bytes
#!/bin/sh
should_auto_checkout() {
[ -f "auto_checkout" ]
}
should_run_auto_checkout() {
[ -x "auto_checkout" ]
}
should_auto_checkout || exit 0
# Kludge to read the last ref
while read old new ref; do
real_sha=$new
done
export GIT_WORK_TREE=$PWD/../
git checkout -qf $real_sha &&
echo "Checked out $real_sha"
if should_run_auto_checkout; then
# Explicitly don't exec the script. It's exist status is irrelevant because
# it's way too late to back out now
./auto_checkout
fi