From 016d83c3fcc42a8bef4e5739a85309beb212a917 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 12 Feb 2019 16:54:14 +0100 Subject: [PATCH] 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 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] --- share/completions/git.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/share/completions/git.fish b/share/completions/git.fish index bda9ac692..869883921 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -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]"