Teach bash how to complete +refspec on git-push
Using `git push origin +foo` to forcefully overwrite the remote branch named foo is a common idiom, especially since + is shorter than the long option --force and can be specified on a per-branch basis. We now complete `git push origin +foo` just like we do the standard `git push origin foo`. The leading + on a branch refspec does not alter the completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
aeb5932845
commit
161fea832a
@ -682,6 +682,9 @@ _git_push ()
|
|||||||
esac
|
esac
|
||||||
__gitcomp "$(__git_refs "$remote")" "" "${cur#*:}"
|
__gitcomp "$(__git_refs "$remote")" "" "${cur#*:}"
|
||||||
;;
|
;;
|
||||||
|
+*)
|
||||||
|
__gitcomp "$(__git_refs)" + "${cur#+}"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
__gitcomp "$(__git_refs)"
|
__gitcomp "$(__git_refs)"
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user