From 4554d8a9b60b899a930f9f346e991ad2740c753b Mon Sep 17 00:00:00 2001 From: Evan Dean Date: Wed, 13 Nov 2019 17:21:40 -0500 Subject: [PATCH] Use repo root when looking for untracked files Currently, if you add a new file to a directory, then cd to a sibling directory, the untracked glyph will not appear. This is inconsistent with the behavior of the other git colors and flags, e.g. if you modify a file and cd into a sibling directory, the prompt will still be red and the dirty working directory glyph will still appear. This PR modifies the query used to find untracked files so it searches from the repo root instead of the current directory. --- fish_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 470d142..cee0399 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -932,7 +932,7 @@ function __bobthefish_prompt_git -S -a git_root_dir -a real_pwd -d 'Display the if [ "$theme_display_git_untracked" != 'no' ] set -l show_untracked (command git config --bool bash.showUntrackedFiles 2>/dev/null) if [ "$show_untracked" != 'false' ] - set new (command git ls-files --other --exclude-standard --directory --no-empty-directory 2>/dev/null) + set new (command git ls-files --other --exclude-standard --directory --no-empty-directory (git rev-parse --show-toplevel) 2>/dev/null) if [ "$new" ] set new "$git_untracked_glyph" end