1
0
Fork 0
mirror of synced 2024-11-22 23:35:35 -05:00

symlink git_current_branch to git-branch-current

This commit is contained in:
Matt Hamilton 2015-12-19 09:42:09 -05:00
parent c577d77fc4
commit 08c9987b38

View file

@ -1,20 +0,0 @@
#
# Displays the current Git branch.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
if ! git rev-parse 2> /dev/null; then
print "$0: not a repository: $PWD" >&2
return 1
fi
local ref="$(git symbolic-ref HEAD 2> /dev/null)"
if [[ -n "$ref" ]]; then
print "${ref#refs/heads/}"
return 0
else
return 1
fi

View file

@ -0,0 +1 @@
git_current_branch