Commit 79e9ce21 authored by Tanay Abhra's avatar Tanay Abhra Committed by Junio C Hamano

add a test for semantic errors in config files

Semantic errors (for example, for alias.* variables NULL values are
not allowed) in configuration files cause a die printing the line
number and file name of the offending value.

Add a test documenting that such errors cause a die printing the
accurate line number and file name.
Signed-off-by: default avatarTanay Abhra <[email protected]>
Reviewed-by: default avatarMatthieu Moy <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 155ef25f
......@@ -197,4 +197,15 @@ test_expect_success 'proper error on error in custom config files' '
test_cmp expect actual
'
test_expect_success 'check line errors for malformed values' '
mv .git/config .git/config.old &&
test_when_finished "mv .git/config.old .git/config" &&
cat >.git/config <<-\EOF &&
[alias]
br
EOF
test_expect_code 128 git br 2>result &&
test_i18ngrep "fatal: .*alias\.br.*\.git/config.*line 2" result
'
test_done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment