From 63e840995e636577d97e925d0469d02be5785277 Mon Sep 17 00:00:00 2001 From: Collin Styles Date: Fri, 18 Oct 2019 13:54:40 -0700 Subject: [PATCH] git-reset: Don't suggest branch completions if -- is present If "--" is present in the command line, it's usually safe to assume that the user is going to want to complete a file tracked by git so let's only suggest branches if "--" isn't 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 06b49ab39..8cc1202b6 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1448,7 +1448,7 @@ complete -r -c git -n '__fish_git_using_command rebase' -l exec -d 'Execute shel ### reset complete -c git -n '__fish_git_needs_command' -a reset -d 'Reset current HEAD to the specified state' complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset files in working directory' -complete -c git -n '__fish_git_using_command reset' -a '(__fish_git_branches)' +complete -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -op)' -a '(__fish_git_branches)' # reset can either undo changes to versioned modified files, # or remove files from the staging area. # Deleted files seem to need a "--" separator.