File tree 3 files changed +15
-8
lines changed
3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -551,13 +551,15 @@ function updatePrompt() {
551
551
}
552
552
553
553
__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
561
563
__add_status " $ResetColor$GIT_PROMPT_SUFFIX "
562
564
563
565
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():
89
89
if st [0 ] == '#' and st [1 ] == '#' :
90
90
if re .search ('Initial commit on' , st [2 ]):
91
91
branch = st [2 ].split (' ' )[- 1 ]
92
+ elif re .search ('No commits yet on' , st [2 ]):
93
+ branch = st [2 ].split (' ' )[- 1 ]
92
94
elif re .search ('no branch' , st [2 ]): # detached status
93
95
branch = get_tag_or_hash ()
94
96
elif len (st [2 ].strip ().split ('...' )) == 1 :
@@ -150,4 +152,3 @@ def get_stash():
150
152
Print (out .encode ('utf-8' ))
151
153
else :
152
154
Print (out )
153
-
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ if [[ "$branch" == *"Initial commit on"* ]]; then
72
72
IFS=" " read -ra fields <<< " $branch"
73
73
branch=" ${fields[3]} "
74
74
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_"
75
79
elif [[ " $branch " == * " no branch" * ]]; then
76
80
tag=$( git describe --tags --exact-match )
77
81
if [[ -n " $tag " ]]; then
You can’t perform that action at this time.
0 commit comments