From d87c0424d86655d8528af5d5f04c4a6c950429a8 Mon Sep 17 00:00:00 2001 From: Sam Yu Date: Sat, 5 Aug 2017 10:03:05 +0800 Subject: [PATCH] Speedup git prompt Fix __fish_git_prompt too slow under repo with lots of untracked files when __fish_git_prompt_showuntrackedfiles enabled. --- share/functions/__fish_git_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 9d3b4fb9d..8416806f8 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -382,7 +382,7 @@ function __fish_git_prompt --description "Prompt function for Git" if set -q __fish_git_prompt_showuntrackedfiles set -l config (command git config --bool bash.showUntrackedFiles) if test "$config" != false - if command git ls-files --others --exclude-standard --error-unmatch -- '*' >/dev/null ^/dev/null + if command git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- '*' >/dev/null ^/dev/null set u $___fish_git_prompt_char_untrackedfiles end end