diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-07-03 15:11:36 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-07-03 15:11:36 +1200 |
commit | e3d886b21e092a93a20a3e218411750aeed3e997 (patch) | |
tree | c64388c3cedbebcdb755879e81f8814964c01e93 /bash | |
parent | Much smarter Git branch finding (diff) | |
download | dotfiles-e3d886b21e092a93a20a3e218411750aeed3e997.tar.gz dotfiles-e3d886b21e092a93a20a3e218411750aeed3e997.zip |
More compatible branch calculation
Still using some old Debian Squeeze servers
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 67efbd70..e34d1f2a 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -33,9 +33,10 @@ function prompt { && return 1 $(git rev-parse --is-inside-work-tree 2>/dev/null ) \ || return 1 - branch=$(git symbolic-ref --quiet --short HEAD 2> /dev/null ) \ + branch=$(git symbolic-ref --quiet HEAD 2>/dev/null ) \ || branch=$(git rev-parse --short HEAD 2>/dev/null ) \ - || branch="(unknown)" + || branch='unknown' + branch=${branch##*/} $(git diff --quiet --ignore-submodules --cached ) \ || state=${state}+ $(git diff-files --quiet --ignore-submodules -- ) \ |