summaryrefslogtreecommitdiff
path: root/t/t1308-config-set.sh
diff options
context:
space:
mode:
authorTanay Abhra <tanayabh@gmail.com>2014-08-07 11:59:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-08-07 18:41:18 (GMT)
commit79e9ce21fa728edef5b7db12710ae24e091b8f9f (patch)
tree928f18afabd86a25b028275f6fd03219ba1eeb46 /t/t1308-config-set.sh
parent155ef25f12329258c06b8875b5e372abec2d348d (diff)
downloadgit-79e9ce21fa728edef5b7db12710ae24e091b8f9f.zip
git-79e9ce21fa728edef5b7db12710ae24e091b8f9f.tar.gz
git-79e9ce21fa728edef5b7db12710ae24e091b8f9f.tar.bz2
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: Tanay Abhra <tanayabh@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1308-config-set.sh')
-rwxr-xr-xt/t1308-config-set.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index 7fdf840..9cc678d 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -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