summaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2016-02-19 10:16:01 +0100
committerJunio C Hamano <gitster@pobox.com>2016-02-22 09:36:33 -0800
commit473166b99078a2724b4fcda11a6a5327b9af60da (patch)
treed20463aea79f73f32735816143441b67e7eca6a5 /t/t1300-repo-config.sh
parent7454ee3c623a6788d91fd3c97af134de33996cfa (diff)
downloadgit-473166b99078a2724b4fcda11a6a5327b9af60da.tar.gz
config: add 'origin_type' to config_source struct
Use the config origin_type to print more detailed error messages that inform the user about the origin of a config error (file, stdin, blob). Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 1782addad4..b9d9398442 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -700,12 +700,18 @@ test_expect_success 'invalid unit' '
git config aninvalid.unit >actual &&
test_cmp expect actual &&
cat >expect <<-\EOF &&
- fatal: bad numeric config value '\''1auto'\'' for '\''aninvalid.unit'\'' in .git/config: invalid unit
+ fatal: bad numeric config value '\''1auto'\'' for '\''aninvalid.unit'\'' in file .git/config: invalid unit
EOF
test_must_fail git config --int --get aninvalid.unit 2>actual &&
test_i18ncmp expect actual
'
+test_expect_success 'invalid stdin config' '
+ echo "fatal: bad config line 1 in standard input " >expect &&
+ echo "[broken" | test_must_fail git config --list --file - >output 2>&1 &&
+ test_cmp expect output
+'
+
cat > expect << EOF
true
false