diff options
authorÆvar Arnfjörð Bjarmason <>2021-09-21 22:40:33 (GMT)
committerJunio C Hamano <>2021-09-23 17:30:43 (GMT)
commitff76fc841f4787e7c91329ecda280f293100eccb (patch)
parent9856ea6785c3dcd19ffb3946c6a9adbd16d9c1da (diff)
help tests: add test for --config output
Add a missing test for checking what the --config output added in ac68a93fd2 (help: add --config to list all available config, 2018-05-26) looks like. We should not be emitting anything except config variables and the brief usage information at the end here. The second test regexp here might not match three-level variables in general, as their second level could contain ".", but in this case we're always emitting what we extract from the documentation, so it's all strings like: foo.<name>.bar If we did introduce something like variable example content here we'd like this to break, since we'd then be likely to break the git-completion.bash. Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
1 files changed, 13 insertions, 0 deletions
diff --git a/t/ b/t/
index 0525ec3..63c4adb 100755
--- a/t/
+++ b/t/
@@ -77,6 +77,19 @@ test_expect_success 'git help -g' '
test_i18ngrep "^ tutorial " help.output
+test_expect_success 'git help -c' '
+ git help -c >help.output &&
+ cat >expect <<-\EOF &&
+ '\''git help config'\'' for more information
+ grep -v -E \
+ -e "^[^.]+\.[^.]+$" \
+ -e "^[^.]+\.[^.]+\.[^.]+$" \
+ help.output >actual &&
+ test_cmp expect actual
test_expect_success 'generate builtin list' '
git --list-cmds=builtins >builtins