summaryrefslogtreecommitdiff
path: root/t/t1300-repo-config.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2012-03-16 20:18:07 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2012-03-16 20:18:07 +0800
commitd90b16ed421eb51fc4d7c6bda5f3332cc2e3aece (patch)
tree2d90d25ecbe794492f0fb267f31af8a1f646327d /t/t1300-repo-config.sh
parentl10n: Improve zh_CN translation for msg "not something we can merge" (diff)
parentGit 1.7.10-rc1 (diff)
downloadtgif-d90b16ed421eb51fc4d7c6bda5f3332cc2e3aece.tar.xz
Merge v1.7.10-rc0 for git l10n update
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-xt/t1300-repo-config.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 5f249f681e..36e227b3bb 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -985,4 +985,35 @@ test_expect_success 'git config --edit respects core.editor' '
test_cmp expect actual
'
+# malformed configuration files
+test_expect_success 'barf on syntax error' '
+ cat >.git/config <<-\EOF &&
+ # broken section line
+ [section]
+ key garbage
+ EOF
+ test_must_fail git config --get section.key >actual 2>error &&
+ grep " line 3 " error
+'
+
+test_expect_success 'barf on incomplete section header' '
+ cat >.git/config <<-\EOF &&
+ # broken section line
+ [section
+ key = value
+ EOF
+ test_must_fail git config --get section.key >actual 2>error &&
+ grep " line 2 " error
+'
+
+test_expect_success 'barf on incomplete string' '
+ cat >.git/config <<-\EOF &&
+ # broken section line
+ [section]
+ key = "value string
+ EOF
+ test_must_fail git config --get section.key >actual 2>error &&
+ grep " line 3 " error
+'
+
test_done