summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-03-05 13:13:00 -0800
committerJunio C Hamano <gitster@pobox.com>2015-03-05 13:13:00 -0800
commit2250406bfdf8d9d890f53b651868363a304a7701 (patch)
treef3b6347563755f13f9d4af9f62d08dae8654c1f1 /t
parent3bef3c12d6c0f5be0e95eb143fdd32583bae7a74 (diff)
parent1d0655c15ebf7dfb460466d058daab790ed285b2 (diff)
downloadgit-2250406bfdf8d9d890f53b651868363a304a7701.tar.gz
Merge branch 'jk/config-no-ungetc-eof' into maint
Reading configuration from a blob object, when it ends with a lone CR, use to confuse the configuration parser. * jk/config-no-ungetc-eof: config_buf_ungetc: warn when pushing back a random character config: do not ungetc EOF
Diffstat (limited to 't')
-rwxr-xr-xt/t1307-config-blob.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t1307-config-blob.sh b/t/t1307-config-blob.sh
index fdc257e66f..3c6791e6be 100755
--- a/t/t1307-config-blob.sh
+++ b/t/t1307-config-blob.sh
@@ -67,4 +67,13 @@ test_expect_success 'parse errors in blobs are properly attributed' '
grep "HEAD:config" err
'
+test_expect_success 'can parse blob ending with CR' '
+ printf "[some]key = value\\r" >config &&
+ git add config &&
+ git commit -m CR &&
+ echo value >expect &&
+ git config --blob=HEAD:config some.key >actual &&
+ test_cmp expect actual
+'
+
test_done