From a4749356ae8d870bed1fad6a7ebb1c6331f78666 Mon Sep 17 00:00:00 2001 From: David Adam Date: Thu, 2 Jun 2022 13:56:35 +0800 Subject: [PATCH] fish_git_prompt: drop --ignored flag in git status Arguments to --ignored were introduced in Git 2.16, from January 2018. The git completions specifically work around this, allowing older versions to be used; match this in the git prompt. Fixes the tests on CentOS 7. --- share/functions/fish_git_prompt.fish | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/functions/fish_git_prompt.fish b/share/functions/fish_git_prompt.fish index cdd2ab798..84bcf10e9 100644 --- a/share/functions/fish_git_prompt.fish +++ b/share/functions/fish_git_prompt.fish @@ -267,7 +267,9 @@ function fish_git_prompt --description "Prompt function for Git" # With just dirty, it's ~20%. set -l opt -uno test "$untracked" = true; and set opt -unormal - set -l stat (command git -c core.fsmonitor= status --porcelain -z --ignored=no $opt | string split0) + # Don't use `--ignored=no`; it was introduced in Git 2.16, from January 2018 + # Ignored files are omitted by default + set -l stat (command git -c core.fsmonitor= status --porcelain -z $opt | string split0) set dirtystate (string match -qr '^.[ACDMR]' -- $stat; and echo 1) if test -n "$sha"