summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-09-18 11:50:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-09-18 11:50:08 -0700
commit95486229e30ca7075dfcb32f33d9719afb047593 (patch)
treef40cef80d1c5763dfefa327139fd89369ece0bf1 /t
parentMerge branch 'js/pre-merge-commit-hook' (diff)
parentcompletion: complete config variables and values for 'git clone --config=' (diff)
downloadtgif-95486229e30ca7075dfcb32f33d9719afb047593.tar.xz
Merge branch 'sg/complete-configuration-variables'
Command line completion updates for "git -c var.name=val" * sg/complete-configuration-variables: completion: complete config variables and values for 'git clone --config=' completion: complete config variables names and values for 'git clone -c' completion: complete values of configuration variables after 'git -c var=' completion: complete configuration sections and variable names for 'git -c' completion: split _git_config() completion: simplify inner 'case' pattern in __gitcomp() completion: use 'sort -u' to deduplicate config variable names completion: deduplicate configuration sections completion: add tests for 'git config' completion completion: complete more values of more 'color.*' configuration variables completion: fix a typo in a comment
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 75512c3403..5d98d66dbd 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1698,6 +1698,69 @@ do
'
done
+test_expect_success 'git config - section' '
+ test_completion "git config br" <<-\EOF
+ branch.Z
+ browser.Z
+ EOF
+'
+
+test_expect_success 'git config - variable name' '
+ test_completion "git config log.d" <<-\EOF
+ log.date Z
+ log.decorate Z
+ EOF
+'
+
+test_expect_success 'git config - value' '
+ test_completion "git config color.pager " <<-\EOF
+ false Z
+ true Z
+ EOF
+'
+
+test_expect_success 'git -c - section' '
+ test_completion "git -c br" <<-\EOF
+ branch.Z
+ browser.Z
+ EOF
+'
+
+test_expect_success 'git -c - variable name' '
+ test_completion "git -c log.d" <<-\EOF
+ log.date=Z
+ log.decorate=Z
+ EOF
+'
+
+test_expect_success 'git -c - value' '
+ test_completion "git -c color.pager=" <<-\EOF
+ false Z
+ true Z
+ EOF
+'
+
+test_expect_success 'git clone --config= - section' '
+ test_completion "git clone --config=br" <<-\EOF
+ branch.Z
+ browser.Z
+ EOF
+'
+
+test_expect_success 'git clone --config= - variable name' '
+ test_completion "git clone --config=log.d" <<-\EOF
+ log.date=Z
+ log.decorate=Z
+ EOF
+'
+
+test_expect_success 'git clone --config= - value' '
+ test_completion "git clone --config=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" &&