From 0988f53c701a4b2cc457c15f076f18f1d6f15f43 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 fb0946580..f99fe5a66 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -383,7 +383,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