Code Review
/
common
/
bash_it.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
1ec1c93
)
added support for git tags
author
Steven Koeberich
<nemesissre@gmail.com>
Mon, 17 Mar 2014 16:29:12 +0000
(17:29 +0100)
committer
Steven Koeberich
<nemesissre@gmail.com>
Mon, 17 Mar 2014 16:29:12 +0000
(17:29 +0100)
themes/base.theme.bash
patch
|
blob
|
history
diff --git
a/themes/base.theme.bash
b/themes/base.theme.bash
index
6453348
..
3a37ce8
100644
(file)
--- a/
themes/base.theme.bash
+++ b/
themes/base.theme.bash
@@
-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]+).+'