]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: treat "branch -D" the same way as "branch -d"
authorJeff King <peff@peff.net>
Tue, 2 Feb 2021 09:02:13 +0000 (04:02 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Feb 2021 21:26:10 +0000 (13:26 -0800)
The former offers not just branches but tags as completion
candidates.

Mimic how "branch -d" limits its suggestion to branch names.

Reported-by: Paul Jolly <paul@myitcv.io>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 463a3124da0a98715e074bf057dac1b67f79b3be..ba950a247d347eef0c924aabb55f92764ea38f4f 100644 (file)
@@ -1438,7 +1438,7 @@ _git_branch ()
        while [ $c -lt $cword ]; do
                i="${words[c]}"
                case "$i" in
-               -d|--delete|-m|--move)  only_local_ref="y" ;;
+               -d|--delete|-D|-m|--move)       only_local_ref="y" ;;
                -r|--remotes)           has_r="y" ;;
                esac
                ((c++))