summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Yalon <git@please.nospammail.net>2011-12-29 11:50:27 +0200
committerAmir Yalon <git@please.nospammail.net>2011-12-29 12:10:12 +0200
commit88c2d0f0df007a83d1faa4313b527bb0b2cf5a36 (patch)
tree3b7d3b5d011d2422e00d32950d55cbe17f1bf1b6
parentfix for enable/disable_set_shell_label (diff)
downloadgit-prompt-88c2d0f0df007a83d1faa4313b527bb0b2cf5a36.tar.gz
git-prompt-88c2d0f0df007a83d1faa4313b527bb0b2cf5a36.tar.bz2
git-prompt-88c2d0f0df007a83d1faa4313b527bb0b2cf5a36.zip
Fix Git freshness check with special chars
-rwxr-xr-xgit-prompt.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-prompt.sh b/git-prompt.sh
index 41aa587..14be89d 100755
--- a/git-prompt.sh
+++ b/git-prompt.sh
@@ -428,9 +428,9 @@ parse_git_status() {
s/^nothing to commi.*/clean=clean/p
s/^# Initial commi.*/init=init/p
- s/^# Your branch is ahead of .[/[:alnum:]]\+. by [[:digit:]]\+ commit.*/freshness=${WHITE}↑/p
- s/^# Your branch is behind .[/[:alnum:]]\+. by [[:digit:]]\+ commit.*/freshness=${YELLOW}↓/p
- s/^# Your branch and .[/[:alnum:]]\+. have diverged.*/freshness=${YELLOW}↕/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
/^# Changes to be committed:/,/^# [A-Z]/ {
s/^# Changes to be committed:/added=added;/p