1
0
Fork 0

remove regex from git-prompt plugin because old zsh don't support regex

pull/1/merge^2
Ashley Dev 14 years ago
parent cb300fb006
commit 1b3fa76a19

@ -498,41 +498,41 @@ _git_prompt__dirty_state ()
_big_repo='yes' _big_repo='yes'
local line local line
while IFS=$'\n' read line; do while IFS=$'\n' read line; do
if [[ "$line" =~ '^M' ]]; then if [[ "$line" = M* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi
if [[ "$line" =~ '^A' ]]; then if [[ "$line" = A* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_ADDED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi
if [[ "$line" =~ '^R' ]]; then if [[ "$line" = R* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi
if [[ "$line" =~ '^C' ]]; then if [[ "$line" = C* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_COPIED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi
if [[ "$line" =~ '^D' ]]; then if [[ "$line" = D* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DELETED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi
if [[ "$line" =~ '^\?\? ' ]]; then if [[ "$line" = \?\?* ]]; then
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
fi fi
if [[ "$line" =~ '^ M' ]]; then if [[ "$line" = \ M* ]]; then
GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED='yes'
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
fi fi
if [[ "$line" =~ '^ D' ]]; then if [[ "$line" = \ D* ]]; then
GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED='yes'
GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_WORKTREE_DIRTY='yes'
fi fi
if [[ "$line" =~ '^UU' ]]; then if [[ "$line" = UU* ]]; then
GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes' GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED='yes'
GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes' GIT_PROMPT_DIRTY_STATE_INDEX_DIRTY='yes'
fi fi

@ -115,7 +115,7 @@ update__GIT_PROMPT_INFO ()
local _prompt="$b$r$s$i$p" local _prompt="$b$r$s$i$p"
# add ( ) around _prompt: # add ( ) around _prompt:
if [ $f = 'yes' ]; then if [ "$f" = 'yes' ]; then
_prompt="($_prompt)" _prompt="($_prompt)"
elif [ "$u" = "yes" ]; then elif [ "$u" = "yes" ]; then
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)" _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"

Loading…
Cancel
Save