Merge pull request #277 from NemesisRE/patch-1

added support for git tags
pull/280/head
Travis Swicegood 2014-04-01 10:24:10 -05:00
commit 8268316930
1 changed files with 1 additions and 2 deletions

View File

@ -83,8 +83,7 @@ function git_prompt_vars {
fi
SCM_PREFIX=${GIT_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
SCM_SUFFIX=${GIT_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
local ref=$(git symbolic-ref HEAD 2> /dev/null)
SCM_BRANCH=${ref#refs/heads/}
SCM_BRANCH=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match 2> /dev/null)
SCM_CHANGE=$(git rev-parse HEAD 2>/dev/null)
local ahead_re='.+ahead ([0-9]+).+'
local behind_re='.+behind ([0-9]+).+'