From acc1023bfd633b7b85d7ff287bddecced9d309d0 Mon Sep 17 00:00:00 2001 From: Ashley Dev Date: Thu, 2 Jun 2011 14:09:05 -0700 Subject: [PATCH] fix up the git prompt when it's a fresh repo --- plugins/git/git-prompt.plugin.zsh | 8 +++----- themes/ashleydev.zsh-theme | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/git/git-prompt.plugin.zsh b/plugins/git/git-prompt.plugin.zsh index 5b575be6c..bafe903e0 100644 --- a/plugins/git/git-prompt.plugin.zsh +++ b/plugins/git/git-prompt.plugin.zsh @@ -148,9 +148,7 @@ # # local _prompt="$b$r$i$s$p" # # add ( ) around _prompt: -# if [ $f = 'yes' ]; then -# _prompt="($_prompt)" -# elif [ "$u" = "yes" ]; then +# if [ "$u" = "yes" ]; then # _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)" # elif [ "$u" = "no" ]; then # _prompt="$_Cu_clean_($_prompt$_Cu_clean_)" @@ -539,11 +537,11 @@ _git_prompt__dirty_state () if [[ "$line" = \?\?* ]]; then GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes' fi - if [[ "$line" = \ M* ]]; then + if [[ "$line" = ?M* ]]; then GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes' fi - if [[ "$line" = \ D* ]]; then + if [[ "$line" = ?D* ]]; then GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes' fi diff --git a/themes/ashleydev.zsh-theme b/themes/ashleydev.zsh-theme index bf0932768..15961b9c6 100644 --- a/themes/ashleydev.zsh-theme +++ b/themes/ashleydev.zsh-theme @@ -111,9 +111,7 @@ update__GIT_PROMPT_INFO () local _prompt="$b$r$i$s$p" # add ( ) around _prompt: - if [ "$f" = 'yes' ]; then - _prompt="($_prompt)" - elif [ "$u" = "yes" ]; then + if [ "$u" = "yes" ]; then _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)" elif [ "$u" = "no" ]; then _prompt="$_Cu_clean_($_prompt$_Cu_clean_)"