mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
git prompt: Don't compute bits we don't need
This commit is contained in:
@@ -221,12 +221,17 @@ function fish_git_prompt --description "Prompt function for Git"
|
|||||||
set -q __fish_git_prompt_showdirtystate
|
set -q __fish_git_prompt_showdirtystate
|
||||||
and set dirty true
|
and set dirty true
|
||||||
end
|
end
|
||||||
|
# If we don't print these, there is no need to compute them.
|
||||||
|
contains dirtystate $__fish_git_prompt_status_order
|
||||||
|
or set dirty false
|
||||||
|
|
||||||
set -l untracked (command git config --bool bash.showUntrackedFiles)
|
set -l untracked (command git config --bool bash.showUntrackedFiles)
|
||||||
if not set -q untracked[1]
|
if not set -q untracked[1]
|
||||||
set -q __fish_git_prompt_showuntrackedfiles
|
set -q __fish_git_prompt_showuntrackedfiles
|
||||||
and set untracked true
|
and set untracked true
|
||||||
end
|
end
|
||||||
|
contains untrackedfiles $__fish_git_prompt_status_order
|
||||||
|
or set untracked false
|
||||||
|
|
||||||
if test true = $inside_worktree
|
if test true = $inside_worktree
|
||||||
# Use informative status if it has been enabled locally, or it has been
|
# Use informative status if it has been enabled locally, or it has been
|
||||||
|
|||||||
Reference in New Issue
Block a user