completion: teach replace to complete options
authorCornelius Weig <redacted>
Fri, 3 Feb 2017 11:01:57 +0000 (12:01 +0100)
committerJunio C Hamano <redacted>
Sat, 4 Feb 2017 06:25:46 +0000 (22:25 -0800)
Git-replace needs to complete references and its own options. In
addition to the existing references completions, do also complete the
options --edit --graft --format= --list --delete.

Signed-off-by: Cornelius Weig <redacted>
Reviewed-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
contrib/completion/git-completion.bash

index 2ed0ef629788a9ad559dbbb0b32537365aa63d44..8c6736e4cf6b4df81b4babe7210eab63a4a261d5 100644 (file)
@@ -2408,6 +2408,12 @@ _git_remote ()
 
 _git_replace ()
 {
+       case "$cur" in
+       --*)
+               __gitcomp "--edit --graft --format= --list --delete"
+               return
+               ;;
+       esac
        __gitcomp_nl "$(__git_refs)"
 }
 
git clone https://git.99rst.org/PROJECT