From: SZEDER Gábor Date: Tue, 13 Aug 2019 12:26:52 +0000 (+0200) Subject: completion: complete config variables and values for 'git clone --config=' X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/5af9d5f6c8530f873ab6a1fce6071c703be2e8d6 completion: complete config variables and values for 'git clone --config=' Completing configuration sections and variable names for the stuck argument of 'git clone --config=' requires a bit of extra care compared to doing the same for the unstuck argument of 'git clone --config ', because we have to deal with that '--config=' being part of the current word to be completed. Add an option to the __git_complete_config_variable_name_and_value() and in turn to the __git_complete_config_variable_name() helper functions to specify the current section/variable name to be completed, so they can be used even when completing the stuck argument of '--config='. __git_complete_config_variable_value() already has such an option, and thus no further changes were necessary to complete possible values after 'git clone --config=section.name='. Signed-off-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 279f04df87..ce7ff0a96d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1406,6 +1406,11 @@ _git_clone () ;; esac case "$cur" in + --config=*) + __git_complete_config_variable_name_and_value \ + --cur="${cur##--config=}" + return + ;; --*) __gitcomp_builtin clone return @@ -2352,35 +2357,41 @@ __git_complete_config_variable_value () # Completes configuration sections, subsections, variable names. # # Usage: __git_complete_config_variable_name [