change git which-branch definition to be compatible with old git.

This commit is contained in:
Ivan Malison 2014-04-13 23:35:59 -07:00
parent dcd1cc3b23
commit 3d022a9fbc

View File

@ -23,7 +23,7 @@
# Diff a file or show it in git's pager if it is untracked
du = "!d() { git ls-files $1 --error-unmatch 2>/dev/null 1>/dev/null && git diff $1 || `git config --get core.pager` $1; }; d"
which-branch = symbolic-ref HEAD --short
which-branch = "!wb() { b="$(git symbolic-ref HEAD)" && echo ${b#refs/heads/}; }; wb" # symbolic-ref HEAD --short
sha = rev-parse HEAD
branch-or-sha = "!bs() { git which-branch 2> /dev/null || git sha 2> /dev/null ; }; bs"
amend = commit -a --amend -C HEAD