Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2019-08-13 15:26:50 +0300
committerJunio C Hamano <gitster@pobox.com>2019-08-13 22:31:04 +0300
commitdd33472831756895a86153c651c18580a6dccbc8 (patch)
tree03efbb35cd3556f8d2272343b977176e2b18c034 /t/t9902-completion.sh
parente1e00089da9f616d23f0ca3bb183258e9013c469 (diff)
completion: complete values of configuration variables after 'git -c var='
'git config' expects a configuration variable's name and value in separate options, so we complete values as they stand on their own on the command line. 'git -c', however, expects them in a single option joined by a '=' character, so we should be able to complete values when they are following 'section.name=' in the same word. Add new options to the __git_complete_config_variable_value() function to allow callers to specify the current word to be completed and the configuration variable whose value is to be completed, and use these to complete possible values after 'git -c 'section.name=<TAB>'. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index bf60a11fa8..9e90a64830 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1733,6 +1733,13 @@ test_expect_success 'git -c - variable name' '
EOF
'
+test_expect_success 'git -c - value' '
+ test_completion "git -c color.pager=" <<-\EOF
+ false Z
+ true Z
+ EOF
+'
+
test_expect_success 'sourcing the completion script clears cached commands' '
__git_compute_all_commands &&
verbose test -n "$__git_all_commands" &&