mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 07:21:14 -03:00
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:
@@ -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 %)
|
||||
|
||||
Reference in New Issue
Block a user