mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 18:21:45 +08:00
completions/git: complete normal files on "git checkout -- "
This can give false positives but only if used on directories that mix tracked and untracked files. The performance is better than listing all tracked files, and in any case we're pretty far from a correct solution that knows the target Git commit, so this seems like good compromise.
This commit is contained in:
parent
2bc8057780
commit
585dc16a66
|
@ -969,6 +969,7 @@ complete -f -c git -n '__fish_git_using_command add' -a '(__fish_git_files modif
|
|||
# TODO options
|
||||
|
||||
### checkout
|
||||
complete -F -c git -n '__fish_git_using_command checkout; and contains -- -- (commandline -opc)'
|
||||
complete -f -c git -n __fish_git_needs_command -a checkout -d 'Checkout and switch to a branch'
|
||||
complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_tags)' -d Tag
|
||||
complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_heads)' -d Head
|
||||
|
|
Loading…
Reference in New Issue
Block a user