From afd8fc3cdfcea4af46856f53c6e5b86ac26905db Mon Sep 17 00:00:00 2001 From: Collin Styles Date: Fri, 13 Dec 2019 12:16:41 -0800 Subject: [PATCH] Correctly suggest files for git-restore when --staged is present Previously we would include all modified, deleted, and unmerged files regardless of what options are present. --- share/completions/git.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index d7d3bac8e..e6f481239 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1528,7 +1528,7 @@ complete -f -c git -n '__fish_git_using_command restore' -l ignore-unmerged -d ' complete -f -c git -n '__fish_git_using_command restore' -l ignore-skip-worktree-bits -d 'Ignore the sparse-checkout file and unconditionally restore any files in ' complete -f -c git -n '__fish_git_using_command restore' -l overlay -d 'Never remove files when restoring' complete -f -c git -n '__fish_git_using_command restore' -l no-overlay -d 'Remove files when restoring (default)' -complete -f -c git -n '__fish_git_using_command restore' -a '(__fish_git_files modified deleted unmerged)' +complete -f -c git -n '__fish_git_using_command restore; and not contains -- --staged (commandline -opc)' -a '(__fish_git_files modified deleted unmerged)' complete -f -c git -n '__fish_git_using_command restore; and contains -- --staged (commandline -opc)' -a '(__fish_git_files added modified-staged deleted-staged renamed copied)' complete -f -c git -n '__fish_git_using_command restore; and __fish_contains_opt -s s source' -a '(git ls-files)' # switch options