completions/git: treat more T files as modified

git-status --porcelain prints status letter T when a file changed type
between either regular file, symlink or submodule.  It can occur in
exactly the same cases as M (modified), so extend the fix for #8311
accordingly.

For submodules, our completions are probably not always correct,
hopefully those cases are rare.
This commit is contained in:
Johannes Altmanninger 2021-10-04 21:32:24 +02:00
parent f9def20180
commit f674c4b010

View File

@ -210,7 +210,7 @@ function __fish_git_files
set -ql renamed
and set file (string replace -r '\t[^\t]*' '' -- "$line[10..-1]")
and set desc $renamed_desc
case '2 RM*'
case '2 RM*' '2 RT*'
# Staged as renamed, with unstaged modifications (issue #6031)
set -ql renamed
or set -ql modified
@ -272,11 +272,11 @@ function __fish_git_files
set -ql modified
and set file "$line[9..-1]"
and set desc $modified_desc
case '1 MD*'
case '1 MD*' '1 TD*'
set -ql modified_staged_deleted
and set file "$line[9..-1]"
and set desc $modified_staged_deleted_desc
case '1 M.*'
case '1 M.*' '1 T.*'
# If the character is first ("M."), then that means it's "our" change,
# which means it is staged.
# This is useless for many commands - e.g. `checkout` won't do anything with this.
@ -284,7 +284,7 @@ function __fish_git_files
set -ql modified_staged
and set file "$line[9..-1]"
and set desc $staged_modified_desc
case '1 MM*'
case '1 MM*' '1 MT*' '1 TM*' '1 TT*'
# Staged-modified with unstaged modifications
# These need to be offered for both kinds of modified.
if set -ql modified