summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t0012-help.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 69e385d..25bbaf0 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -41,7 +41,8 @@ test_expect_success 'invalid usage' '
test_expect_code 129 git help -g add &&
test_expect_code 129 git help -a -g &&
- test_expect_code 129 git help -g -c
+ test_expect_code 129 git help -g -c &&
+ test_expect_code 0 git help --config-for-completion add
'
test_expect_success "works for commands and guides by default" '
@@ -96,6 +97,20 @@ test_expect_success 'git help -c' '
test_cmp expect actual
'
+test_expect_success 'git help --config-for-completion' '
+ git help -c >human &&
+ grep -E \
+ -e "^[^.]+\.[^.]+$" \
+ -e "^[^.]+\.[^.]+\.[^.]+$" human |
+ sed -e "s/\*.*//" -e "s/<.*//" |
+ sort -u >human.munged &&
+
+ git help --config-for-completion >vars &&
+ sort -u <vars >vars.new &&
+ mv vars.new vars &&
+ test_cmp human.munged vars
+'
+
test_expect_success 'generate builtin list' '
git --list-cmds=builtins >builtins
'