summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2019-08-13 14:26:51 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-08-13 12:31:04 -0700
commit88cd790d6a88be51d5aa480d548249cc46b02e0d (patch)
tree27aa18ec4637db3edc6454f4e9f9b8fb67187405 /contrib/completion/git-completion.bash
parentcompletion: complete values of configuration variables after 'git -c var=' (diff)
downloadtgif-88cd790d6a88be51d5aa480d548249cc46b02e0d.tar.xz
completion: complete config variables names and values for 'git clone -c'
The previous commits taught the completion script how to complete configuration section, variable names, and their valus after 'git -c <TAB>', and with a bit of foresight encapsulated all that in a dedicated helper function. Use that function to complete the unstuck argument of 'git config -c|--config <TAB>', which expect configuration variables and values in the same 'section.name=value' form. Note that handling the struck argument for 'git clone --config=<TAB>' requires some extra care, so it will be done a separate patch. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6f2bc60707..279f04df87 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1399,6 +1399,12 @@ _git_clean ()
_git_clone ()
{
+ case "$prev" in
+ -c|--config)
+ __git_complete_config_variable_name_and_value
+ return
+ ;;
+ esac
case "$cur" in
--*)
__gitcomp_builtin clone