diff options
author | Ted Vessenes <tvessene@akamai.com> | 2012-07-31 13:27:40 -0400 |
---|---|---|
committer | Ted Vessenes <tvessene@akamai.com> | 2012-07-31 13:27:40 -0400 |
commit | 027fcccc9256aaf63e0d1b812069a1a0880f46fa (patch) | |
tree | 306d5c0eb0b84e90f5dc48c6977eddc537a7a555 /lib | |
parent | d05b2010ffd4cd33ff9402c402051b1caf985d97 (diff) | |
download | zsh-027fcccc9256aaf63e0d1b812069a1a0880f46fa.tar.gz zsh-027fcccc9256aaf63e0d1b812069a1a0880f46fa.tar.bz2 zsh-027fcccc9256aaf63e0d1b812069a1a0880f46fa.zip |
Make git use sha when branch name is missing.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/git.zsh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/git.zsh b/lib/git.zsh index fb4ad8ca6..af8b153d9 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,6 +1,7 @@ # get the name of the branch we are on function git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return + ref=$(git symbolic-ref HEAD 2> /dev/null) || \ + ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" } |