2015-12-18 10:57:19 -05:00
|
|
|
# slightly modified git_current_branch from oh-my-zsh for theme compatibility
|
|
|
|
local ref
|
|
|
|
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
|
2015-12-19 09:48:29 -05:00
|
|
|
local ret=${?}
|
|
|
|
if [[ ${ret} != 0 ]]; then
|
|
|
|
[[ ${ret} == 128 ]] && return # no git repo.
|
2015-12-18 10:57:19 -05:00
|
|
|
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
|
|
|
|
fi
|
|
|
|
print ${ref#refs/heads/}
|