From 354bb1f5a4374da634e6ba37f4109f4ddf169347 Mon Sep 17 00:00:00 2001 From: Haak Saxberg Date: Wed, 19 Mar 2014 10:30:05 -0700 Subject: [PATCH] fix the state part of the git prompt --- bash-files/bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash-files/bashrc b/bash-files/bashrc index f89aee1..1d5abcf 100644 --- a/bash-files/bashrc +++ b/bash-files/bashrc @@ -21,7 +21,7 @@ parse_git_branch() { branch_pattern="^# On branch ([^${IFS}]*)" remote_pattern="# Your branch is (.*) of" diverge_pattern="# Your branch and (.*) have diverged" - if [[ ! ${git_status} =~ "working directory clean" ]]; then + if [[ ! ${git_status} =~ "nothing to commit" ]]; then state="${RED}!" else state="" @@ -39,7 +39,7 @@ parse_git_branch() { fi if [[ ${git_status} =~ ${branch_pattern} ]]; then branch=${BASH_REMATCH[1]} - echo " $RED(${branch} ${remote}${state}) " + echo " $RED(${branch} ${remote}${state}$RED) " fi }