Skip to content

Commit 88cd790

Browse files
szedergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dd33472 commit 88cd790

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,12 @@ _git_clean ()
13991399

14001400
_git_clone ()
14011401
{
1402+
case "$prev" in
1403+
-c|--config)
1404+
__git_complete_config_variable_name_and_value
1405+
return
1406+
;;
1407+
esac
14021408
case "$cur" in
14031409
--*)
14041410
__gitcomp_builtin clone

0 commit comments

Comments
 (0)