completion: handle other variants of "branch -m"

We didn't special-case "branch -M" (with a capital M) the same as "branch -m", nor any of the "--copy" variants. As a result these offered any ref as the next candidate, and not just branch names. Note that I rewrapped case-arm line since it's now quite long, and likewise the one below it for consistency. I also re-ordered the existing "-D" to make it more obvious how the cases group together. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Feb 3, 2021 at 15:59 UTC bca362c1f94164f23e1c9b5cf833804d46315cbe
1 file changed +4 -2
contrib/completion/git-completion.bash
+4 -2
@@ -1438,8 +1438,10 @@ _git_branch ()
1438 while [ $c -lt $cword ]; do
1439 i="${words[c]}"
1440 case "$i" in
1441 - -d|--delete|-D|-m|--move) only_local_ref="y" ;;
1442 - -r|--remotes) has_r="y" ;;
1441 + -d|-D|--delete|-m|-M|--move|-c|-C|--copy)
1442 + only_local_ref="y" ;;
1443 + -r|--remotes)
1444 + has_r="y" ;;
1445 esac
1446 ((c++))
1447 done