]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/complete-branch-force-delete'
authorJunio C Hamano <gitster@pobox.com>
Fri, 12 Feb 2021 22:21:04 +0000 (14:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Feb 2021 22:21:04 +0000 (14:21 -0800)
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"

Documentation/git-branch.txt
contrib/completion/git-completion.bash

index adaa1782a8b26d4c5fb498ff3a1d33abb8e6ac19..eb815c22484ef6b67b09c787d9b0caabb0098028 100644 (file)
@@ -78,8 +78,8 @@ renaming. If <newbranch> exists, -M must be used to force the rename
 to happen.
 
 The `-c` and `-C` options have the exact same semantics as `-m` and
-`-M`, except instead of the branch being renamed it along with its
-config and reflog will be copied to a new name.
+`-M`, except instead of the branch being renamed, it will be copied to a
+new name, along with its config and reflog.
 
 With a `-d` or `-D` option, `<branchname>` will be deleted.  You may
 specify more than one branch for deletion.  If the branch currently
index 4b1f4264a64e6d8bf4c09fae8573f86726f5cad1..7dc6cd8eb8381d66a75e443970adb768befe866c 100644 (file)
@@ -1447,8 +1447,10 @@ _git_branch ()
        while [ $c -lt $cword ]; do
                i="${words[c]}"
                case "$i" in
-               -d|--delete|-m|--move)  only_local_ref="y" ;;
-               -r|--remotes)           has_r="y" ;;
+               -d|-D|--delete|-m|-M|--move|-c|-C|--copy)
+                       only_local_ref="y" ;;
+               -r|--remotes)
+                       has_r="y" ;;
                esac
                ((c++))
        done