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 <>
 t/ | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/ b/t/
index 7fdf840..bd033df 100755
--- a/t/
+++ b/t/
@@ -197,4 +197,12 @@ test_expect_success 'proper error on error in custom 
config files' '
        test_cmp expect actual
+test_expect_success 'check line errors for malformed values' '
+       cp .git/config .git/config.old &&
+       test_when_finished "mv .git/config.old .git/config" &&
+       echo "[alias]\n br" >.git/config &&
+       test_expect_code 128 git br 2>result &&
+       grep "fatal: bad config file line 2 in .git/config" result

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to