Skip to content

Commit

Permalink
Merge pull request #5 from ChoiZ/patch-1
Browse files Browse the repository at this point in the history
Fix remote
  • Loading branch information
Matthew McCullough committed Nov 21, 2013
2 parents 48ac7ba + fcfc102 commit bbc0bb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bash_gitprompt
Expand Up @@ -17,15 +17,15 @@ function parse_git_branch {
git rev-parse --git-dir &> /dev/null
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
remote_pattern="# Your branch is (.*) of"
remote_pattern="# Your branch is (.*) '"
diverge_pattern="# Your branch and (.*) have diverged"

if [[ ! ${git_status}} =~ "working directory clean" ]]; then
state="${RED}"
fi
# add an else if or two here if you want to get more specific
if [[ ${git_status} =~ ${remote_pattern} ]]; then
if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
if [[ ${BASH_REMATCH[1]} == "ahead of" ]]; then
remote="${YELLOW}"
else
remote="${YELLOW}"
Expand Down

0 comments on commit bbc0bb5

Please sign in to comment.