Skip to content

Commit bca362c

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a534cf4 commit bca362c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,10 @@ _git_branch ()
14381438
while [ $c -lt $cword ]; do
14391439
i="${words[c]}"
14401440
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" ;;
14431445
esac
14441446
((c++))
14451447
done

0 commit comments

Comments
 (0)