mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03:00
completions/git: Handle MM files
These are files with staged modifications, and additional unstaged ones. In practice what happened was that you ran git add somefile then editted it some more and tried to git add <TAB> which didn't offer it anymore. Now, we offer it if either modified or modified-staged is set. Currently modified-staged isn't ever set alone, but through all-staged, so we still need to keep offering the file then. (This shows that the current switch/case might have some holes) Fixes #5648. [ci skip]
This commit is contained in:
@@ -206,6 +206,16 @@ function __fish_git_files
|
||||
set -ql modified_staged
|
||||
and set file "$line[9..-1]"
|
||||
and set desc $staged_modified_desc
|
||||
case '1 MM*'
|
||||
# Staged-modified with unstaged modifications
|
||||
# These need to be offered for both kinds of modified.
|
||||
if set -ql modified
|
||||
set file "$line[9..-1]"
|
||||
set desc $modified_desc
|
||||
else if set -ql modified_staged
|
||||
set file "$line[9..-1]"
|
||||
set desc $staged_modified_desc
|
||||
end
|
||||
case '1 .D*'
|
||||
set -ql deleted
|
||||
and set file "$line[9..-1]"
|
||||
|
||||
Reference in New Issue
Block a user