From 88c2d0f0df007a83d1faa4313b527bb0b2cf5a36 Mon Sep 17 00:00:00 2001 From: Amir Yalon Date: Thu, 29 Dec 2011 11:50:27 +0200 Subject: Fix Git freshness check with special chars --- git-prompt.sh | 6 +++--- 1 file 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 -- cgit v1.2.3