File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -551,13 +551,15 @@ function updatePrompt() {
551551 }
552552
553553 __chk_gitvar_status ' REMOTE' ' -n'
554- __add_status " $GIT_PROMPT_SEPARATOR "
555- __chk_gitvar_status ' STAGED' ' -ne 0'
556- __chk_gitvar_status ' CONFLICTS' ' -ne 0'
557- __chk_gitvar_status ' CHANGED' ' -ne 0'
558- __chk_gitvar_status ' UNTRACKED' ' -ne 0'
559- __chk_gitvar_status ' STASHED' ' -ne 0'
560- __chk_gitvar_status ' CLEAN' ' -eq 1' -
554+ if [[ $GIT_CLEAN -eq 0 ]] || [[ $GIT_PROMPT_CLEAN != " " ]]; then
555+ __add_status " $GIT_PROMPT_SEPARATOR "
556+ __chk_gitvar_status ' STAGED' ' -ne 0'
557+ __chk_gitvar_status ' CONFLICTS' ' -ne 0'
558+ __chk_gitvar_status ' CHANGED' ' -ne 0'
559+ __chk_gitvar_status ' UNTRACKED' ' -ne 0'
560+ __chk_gitvar_status ' STASHED' ' -ne 0'
561+ __chk_gitvar_status ' CLEAN' ' -eq 1' -
562+ fi
561563 __add_status " $ResetColor$GIT_PROMPT_SUFFIX "
562564
563565 NEW_PROMPT=" $( gp_add_virtualenv_to_prompt) $PROMPT_START $( $prompt_callback ) $STATUS_PREFIX$STATUS$PROMPT_END "
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ def get_stash():
8989 if st [0 ] == '#' and st [1 ] == '#' :
9090 if re .search ('Initial commit on' , st [2 ]):
9191 branch = st [2 ].split (' ' )[- 1 ]
92+ elif re .search ('No commits yet on' , st [2 ]):
93+ branch = st [2 ].split (' ' )[- 1 ]
9294 elif re .search ('no branch' , st [2 ]): # detached status
9395 branch = get_tag_or_hash ()
9496 elif len (st [2 ].strip ().split ('...' )) == 1 :
@@ -150,4 +152,3 @@ def get_stash():
150152 Print (out .encode ('utf-8' ))
151153else :
152154 Print (out )
153-
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ if [[ "$branch" == *"Initial commit on"* ]]; then
7272 IFS=" " read -ra fields <<< " $branch"
7373 branch=" ${fields[3]} "
7474 remote=" _NO_REMOTE_TRACKING_"
75+ elif [[ " $branch " == * " No commits yet on" * ]]; then
76+ IFS=" " read -ra fields <<< " $branch"
77+ branch=" ${fields[4]} "
78+ remote=" _NO_REMOTE_TRACKING_"
7579elif [[ " $branch " == * " no branch" * ]]; then
7680 tag=$( git describe --tags --exact-match )
7781 if [[ -n " $tag " ]]; then
You can’t perform that action at this time.
0 commit comments