mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-20 15:25:31 +08:00
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.
This commit is contained in:
parent
3de3a34e79
commit
63e840995e
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user