summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonid Volnitsky <Leonid@Volnitsky.com>2013-12-10 19:58:09 +0200
committerLeonid Volnitsky <Leonid@Volnitsky.com>2013-12-10 19:58:09 +0200
commiteeff805e0bcdab5317ed1027bef2b625a8f7f94b (patch)
tree7c0c378bbf9c3ff8bb194542bbc4bf19a53da3cf
parentfixed: filenames with special chars (diff)
downloadgit-prompt-eeff805e0bcdab5317ed1027bef2b625a8f7f94b.tar.gz
git-prompt-eeff805e0bcdab5317ed1027bef2b625a8f7f94b.tar.bz2
git-prompt-eeff805e0bcdab5317ed1027bef2b625a8f7f94b.zip
fix for issue #37 (branch detection with new git)
-rwxr-xr-xgit-prompt.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index f99a1d0..1cf4b4e 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -433,12 +433,12 @@ parse_git_status() {
eval " $(
git status 2>/dev/null |
sed -n '
- s/^# On branch /branch=/p
+ s/^\(# \)*On branch /branch=/p
s/^nothing to commi.*/clean=clean/p
- s/^# Initial commi.*/init=init/p
- s/^# Your branch is ahead of \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p
- s/^# Your branch is behind \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p
- s/^# Your branch and \(.\).\+\1 have diverged.*/freshness=${YELLOW}↕/p
+ s/^\(# \)*Initial commi.*/init=init/p
+ s/^\(# \)*Your branch is ahead of \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p
+ s/^\(# \)*Your branch is behind \(.\).\+\1 by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p
+ s/^\(# \)*Your branch and \(.\).\+\1 have diverged.*/freshness=${YELLOW}↕/p
'
)"