]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: complete refs after 'git restore -s'
authorÁkos Uzonyi <uzonyi.akos@gmail.com>
Fri, 25 Sep 2020 21:11:24 +0000 (23:11 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 26 Sep 2020 22:30:05 +0000 (15:30 -0700)
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>
contrib/completion/git-completion.bash

index 3d02bd4de7ee303724a97d1a71113bba4f13f4aa..0a96ad87e7b6d8723175d3b97c18921ddc737d7b 100644 (file)
@@ -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=}"