]> git.ipfire.org Git - thirdparty/git.git/commit - contrib/completion/git-completion.bash
completion: complete config variables and values for 'git clone --config='
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 13 Aug 2019 12:26:52 +0000 (14:26 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Aug 2019 19:31:05 +0000 (12:31 -0700)
commit5af9d5f6c8530f873ab6a1fce6071c703be2e8d6
tree2b4dff14dc6b3b1eb274d019554894562b8ef192
parent88cd790d6a88be51d5aa480d548249cc46b02e0d
completion: complete config variables and values for 'git clone --config='

Completing configuration sections and variable names for the stuck
argument of 'git clone --config=<TAB>' requires a bit of extra care
compared to doing the same for the unstuck argument of 'git clone
--config <TAB>', 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=<TAB>'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
t/t9902-completion.sh