Skip to content

Commit

Permalink
Add separator to status only if something follow it
Browse files Browse the repository at this point in the history
  • Loading branch information
iliakan committed Jul 30, 2017
1 parent a8b3d9e commit 806889d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions gitprompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,15 @@ function updatePrompt() {
}

__chk_gitvar_status 'REMOTE' '-n'
__add_status "$GIT_PROMPT_SEPARATOR"
__chk_gitvar_status 'STAGED' '-ne 0'
__chk_gitvar_status 'CONFLICTS' '-ne 0'
__chk_gitvar_status 'CHANGED' '-ne 0'
__chk_gitvar_status 'UNTRACKED' '-ne 0'
__chk_gitvar_status 'STASHED' '-ne 0'
__chk_gitvar_status 'CLEAN' '-eq 1' -
if [[ $GIT_CLEAN -eq 0 ]] || [[ $GIT_PROMPT_CLEAN != "" ]]; then
__add_status "$GIT_PROMPT_SEPARATOR"
__chk_gitvar_status 'STAGED' '-ne 0'
__chk_gitvar_status 'CONFLICTS' '-ne 0'
__chk_gitvar_status 'CHANGED' '-ne 0'
__chk_gitvar_status 'UNTRACKED' '-ne 0'
__chk_gitvar_status 'STASHED' '-ne 0'
__chk_gitvar_status 'CLEAN' '-eq 1' -
fi
__add_status "$ResetColor$GIT_PROMPT_SUFFIX"

NEW_PROMPT="$(gp_add_virtualenv_to_prompt)$PROMPT_START$($prompt_callback)$STATUS_PREFIX$STATUS$PROMPT_END"
Expand Down

0 comments on commit 806889d

Please sign in to comment.