summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-09-17 08:04:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-17 22:23:22 (GMT)
commit93ab00bd857c31a3aa5318120d162825303048c7 (patch)
tree542078510c565177881da092b6a91a5094f55b4e /contrib/completion
parent54e85e7af1ac9e9a92888060d6811ae767fea1bc (diff)
downloadgit-93ab00bd857c31a3aa5318120d162825303048c7.zip
git-93ab00bd857c31a3aa5318120d162825303048c7.tar.gz
git-93ab00bd857c31a3aa5318120d162825303048c7.tar.bz2
contrib/completion: complete options that take refs for format-patch
The completion for format-patch currently suggests --base=, --interdiff= and --range-diff= as options. However, with these `=` forms of the options, there is no space and we'd enter the `--*` case which means we don't call the __git_complete_revlist() at the end. Teach _git_format_patch() to complete refs in the case of --base=, --interdiff= and --range-diff=. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9147fba..8be4a03 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1784,6 +1784,10 @@ _git_format_patch ()
" "" "${cur##--thread=}"
return
;;
+ --base=*|--interdiff=*|--range-diff=*)
+ __git_complete_refs --cur="${cur#--*=}"
+ return
+ ;;
--*)
__gitcomp_builtin format-patch "$__git_format_patch_extra_options"
return