From 78931d78bd91e3175cf3e47ff81312a14139a883 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 6 Apr 2019 21:45:17 +0200 Subject: [PATCH] completions/git: Handle diff --cached Fixes #5785. [ci skip] --- share/completions/git.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 6293142e7..7d2530276 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -911,7 +911,8 @@ complete -c git -n '__fish_git_using_command diff' -s 1 -l base -d 'Compare the complete -c git -n '__fish_git_using_command diff' -s 2 -l ours -d 'Compare the working tree with the "our branch"' complete -c git -n '__fish_git_using_command diff' -s 3 -l theirs -d 'Compare the working tree with the "their branch"' complete -c git -n '__fish_git_using_command diff' -s 0 -d 'Omit diff output for unmerged entries and just show "Unmerged"' -complete -f -c git -n '__fish_git_using_command diff' -a '(__fish_git_files modified deleted)' +complete -c git -n '__fish_git_using_command diff; and not __fish_contains_opt cached' -fa '(__fish_git_files modified deleted)' +complete -c git -n '__fish_git_using_command diff; and __fish_contains_opt cached' -fa '(__fish_git_files modified-staged deleted-staged)' ### Function to list available tools for git difftool and mergetool