mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
fix up the git prompt when it's a fresh repo
This commit is contained in:
parent
fcbca579ae
commit
acc1023bfd
2 changed files with 4 additions and 8 deletions
|
|
@ -148,9 +148,7 @@
|
||||||
#
|
#
|
||||||
# local _prompt="$b$r$i$s$p"
|
# local _prompt="$b$r$i$s$p"
|
||||||
# # add ( ) around _prompt:
|
# # add ( ) around _prompt:
|
||||||
# if [ $f = 'yes' ]; then
|
# if [ "$u" = "yes" ]; then
|
||||||
# _prompt="($_prompt)"
|
|
||||||
# elif [ "$u" = "yes" ]; then
|
|
||||||
# _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
# _prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
||||||
# elif [ "$u" = "no" ]; then
|
# elif [ "$u" = "no" ]; then
|
||||||
# _prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
# _prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
||||||
|
|
@ -539,11 +537,11 @@ _git_prompt__dirty_state ()
|
||||||
if [[ "$line" = \?\?* ]]; then
|
if [[ "$line" = \?\?* ]]; then
|
||||||
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='yes'
|
GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED='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
|
||||||
|
|
|
||||||
|
|
@ -111,9 +111,7 @@ update__GIT_PROMPT_INFO ()
|
||||||
|
|
||||||
local _prompt="$b$r$i$s$p"
|
local _prompt="$b$r$i$s$p"
|
||||||
# add ( ) around _prompt:
|
# add ( ) around _prompt:
|
||||||
if [ "$f" = 'yes' ]; then
|
if [ "$u" = "yes" ]; then
|
||||||
_prompt="($_prompt)"
|
|
||||||
elif [ "$u" = "yes" ]; then
|
|
||||||
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
_prompt="$_Cu_dirty_($_prompt$_Cu_dirty_)"
|
||||||
elif [ "$u" = "no" ]; then
|
elif [ "$u" = "no" ]; then
|
||||||
_prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
_prompt="$_Cu_clean_($_prompt$_Cu_clean_)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue