Skip to content

Commit 006c5f7

Browse files
committed
Merge branch 'jk/complete-branch-force-delete'
The command line completion (in contrib/) completed "git branch -d" with branch names, but "git branch -D" offered tagnames in addition, which has been corrected. "git branch -M" had the same problem. * jk/complete-branch-force-delete: doc/git-branch: fix awkward wording for "-c" completion: handle other variants of "branch -m" completion: treat "branch -D" the same way as "branch -d"
2 parents 60f8121 + 27dc071 commit 006c5f7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Documentation/git-branch.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ renaming. If <newbranch> exists, -M must be used to force the rename
7878
to happen.
7979

8080
The `-c` and `-C` options have the exact same semantics as `-m` and
81-
`-M`, except instead of the branch being renamed it along with its
82-
config and reflog will be copied to a new name.
81+
`-M`, except instead of the branch being renamed, it will be copied to a
82+
new name, along with its config and reflog.
8383

8484
With a `-d` or `-D` option, `<branchname>` will be deleted. You may
8585
specify more than one branch for deletion. If the branch currently

contrib/completion/git-completion.bash

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,8 +1447,10 @@ _git_branch ()
14471447
while [ $c -lt $cword ]; do
14481448
i="${words[c]}"
14491449
case "$i" in
1450-
-d|--delete|-m|--move) only_local_ref="y" ;;
1451-
-r|--remotes) has_r="y" ;;
1450+
-d|-D|--delete|-m|-M|--move|-c|-C|--copy)
1451+
only_local_ref="y" ;;
1452+
-r|--remotes)
1453+
has_r="y" ;;
14521454
esac
14531455
((c++))
14541456
done

0 commit comments

Comments
 (0)