git prompt: Respect status_order even without informative status

Fixes #7926.

Also switches the default status order for non-informative to the informative one:

stagedstate invalidstate dirtystate untrackedfiles stashstate

instead of

dirty staged stash untracked
This commit is contained in:
Fabian Homborg
2021-04-13 15:58:55 +02:00
parent a65933551d
commit 71166274a2
2 changed files with 55 additions and 28 deletions

View File

@@ -40,11 +40,36 @@ fish_git_prompt
echo # the git prompt doesn't print a newline
#CHECK: (newbranch)
__fish_git_prompt_show_informative_status=1 fish_git_prompt
set -g __fish_git_prompt_show_informative_status 1
fish_git_prompt
echo
#CHECK: (newbranch|1)
set -e __fish_git_prompt_show_informative_status
# Confirm the mode changes back
fish_git_prompt
echo
#CHECK: (newbranch)
# (for some reason stagedstate is only shown with showdirtystate?)
set -g __fish_git_prompt_showdirtystate 1
git add foo
fish_git_prompt
echo
#CHECK: (newbranch +)
set -g __fish_git_prompt_showuntrackedfiles 1
touch bananan
fish_git_prompt
echo
#CHECK: (newbranch +%)
set -g __fish_git_prompt_status_order untrackedfiles stagedstate
fish_git_prompt
echo
#CHECK: (newbranch %+)
set -g __fish_git_prompt_status_order untrackedfiles
fish_git_prompt
echo
#CHECK: (newbranch %)