added support for git tags

pull/261/head
Steven Koeberich 2014-03-17 17:29:12 +01:00 committed by Hector Rivas
parent b68b9fa09d
commit b912f3292e
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]+).+'