From 07e512ecd8435ba4789a84fe0bd72a13aa0624bd Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 23 Sep 2021 15:22:23 +0200 Subject: [PATCH] completions/git: Treat T files same as modified This is weirdly undocumented (as of git 2.33.0), but `git status` prints a "T" state if the file has its "T"ype changed, e.g. from a regular file to a symlink. For our purposes that's just another kind of modification. Fixes #8311. --- share/completions/git.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 435d9175d..d4158c6c4 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -247,8 +247,11 @@ function __fish_git_files set file "$line[9..-1]" set desc $deleted_desc end - case "1 AM*" + case "1 AM*" "1 AT*" # Added files with additional modifications + # ("T" is type-changed. As of git 2.33 this appears to be undocumented. + # it happens when e.g. a file is replaced with a symlink. + # For our purposes it's the same as modified) if set -ql added set file "$line[9..-1]" set desc $added_desc @@ -261,7 +264,7 @@ function __fish_git_files set -ql untracked and set file "$line[9..-1]" and set desc $untracked_desc - case '1 .M*' + case '1 .M*' '1 .T*' # Modified # From the docs: "Ordinary changed entries have the following format:" # "1 "