completions/git: do not attempt to complete rev:file in option words

Fixes #8139
This commit is contained in:
Johannes Altmanninger 2021-07-13 23:59:23 +02:00
parent 36d9e7b6d6
commit 6c22c0e30d

View File

@ -514,7 +514,7 @@ function __fish_git_needs_rev_files
# This definitely works with `git show` to retrieve a copy of a file as it exists
# in the index of revision $rev, it should be updated to include others as they
# are identified.
__fish_git_using_command show; and string match -r ".+:" -- (commandline -ot)
__fish_git_using_command show; and string match -r "^[^-].*:" -- (commandline -ot)
end
function __fish_git_ranges