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"
This commit is contained in:
Junio C Hamano
2021-02-12 14:21:04 -08:00
2 changed files with 6 additions and 4 deletions

View 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