diff options
-rwxr-xr-x | gitolite/dotfiles/local/triggers/push | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gitolite/dotfiles/local/triggers/push b/gitolite/dotfiles/local/triggers/push index 7a3cb56..2c5e060 100755 --- a/gitolite/dotfiles/local/triggers/push +++ b/gitolite/dotfiles/local/triggers/push @@ -7,8 +7,7 @@ head=$(git symbolic-ref HEAD) if ! [ -f "$head" ]; then set -- refs/heads/* - if [ "$#" -eq 1 ]; then - git symbolic-ref HEAD "$1" + if [ $# -eq 1 ] && git symbolic-ref HEAD "$1" >/dev/null 2>&1; then echo "NOTICE: Default branch set to $1" >&2 else echo "WARNING: The default branch is $head, but no such branch exists" >&2 |