summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorÁkos Uzonyi <uzonyi.akos@gmail.com>2020-09-25 21:11:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-26 22:30:05 (GMT)
commit0bc18daa2f5d05b1b77293aef391008e07076d02 (patch)
tree02ae10e920814d41c9c2b145f79888eb6041a470 /contrib/completion/git-completion.bash
parentc09d1280f7787020e28844e8fd615d973d2a811e (diff)
downloadgit-0bc18daa2f5d05b1b77293aef391008e07076d02.zip
git-0bc18daa2f5d05b1b77293aef391008e07076d02.tar.gz
git-0bc18daa2f5d05b1b77293aef391008e07076d02.tar.bz2
completion: complete refs after 'git restore -s'
Currently only the long version (--source=) supports completion. Add completion support to the short (-s) option too. Signed-off-by: Ákos Uzonyi <uzonyi.akos@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 3d02bd4..0a96ad8 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2841,6 +2841,13 @@ _git_reset ()
_git_restore ()
{
+ case "$prev" in
+ -s)
+ __git_complete_refs
+ return
+ ;;
+ esac
+
case "$cur" in
--conflict=*)
__gitcomp "diff3 merge" "" "${cur##--conflict=}"