summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2012-07-07 09:22:24 +0300
committerLeonid Volnitsky <Leonid@Volnitsky.com>2012-07-07 09:22:24 +0300
commit233c72eaf7e4b77f62fa857f6f2011dbb60a4040 (patch)
tree044a08d1c7c175909f0b7e36c0d9f393e38d11f0
parentsubstitute branch name "master" for "M" only if it starts with "master" (diff)
downloadgit-prompt-233c72eaf7e4b77f62fa857f6f2011dbb60a4040.tar.gz
git-prompt-233c72eaf7e4b77f62fa857f6f2011dbb60a4040.tar.bz2
git-prompt-233c72eaf7e4b77f62fa857f6f2011dbb60a4040.zip
do not display "=" before rawhex if there is freshness indicator
-rwxr-xr-xgit-prompt.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 2853909..cb3c296 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -425,7 +425,8 @@ parse_git_status() {
added_files=()
modified_files=()
untracked_files=()
- freshness="$dim"
+ [[ $rawhex_len -gt 0 ]] && freshness="$dim="
+
unset branch status modified added clean init added mixed untracked op detached
# info not in porcelain status
@@ -502,7 +503,7 @@ parse_git_status() {
if [[ $rawhex_len -gt 0 ]] ; then
rawhex=`git rev-parse HEAD 2>/dev/null`
rawhex=${rawhex/HEAD/}
- rawhex="=$hex_vcs_color${rawhex:0:$rawhex_len}"
+ rawhex="$hex_vcs_color${rawhex:0:$rawhex_len}"
else
rawhex=""
fi