Suggest unique remote branches for git-switch

From the `git-switch` documentation:

If <branch> is not found but there does exist a tracking branch in
exactly one remote (call it <remote>) with a matching name, treat as
equivalent to

   $ git switch -c <branch> --track <remote>/<branch>
This commit is contained in:
Collin Styles 2019-12-13 12:27:22 -08:00 committed by Johannes Altmanninger
parent afd8fc3cdf
commit 012773436e

View file

@ -1534,6 +1534,7 @@ complete -f -c git -n '__fish_git_using_command restore; and __fish_contains_opt
# switch options
complete -f -c git -n '__fish_git_needs_command' -a switch -d 'Switch to a branch'
complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_branches)'
complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
complete -f -c git -n '__fish_git_using_command switch' -r -s c -l create -d 'Create a new branch'
complete -f -c git -n '__fish_git_using_command switch' -r -s C -l force-create -d 'Force create a new branch'
complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment'