aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-11-17 15:02:08 -0800
committerJunio C Hamano <gitster@pobox.com>2010-11-17 15:02:08 -0800
commit6f49ed6153be9f37d48bdec4a036a8b8a5629590 (patch)
tree285010e41604c0d8990c94f7dd1440cdfd96df87 /t
parent44e4155f8356a33e04a23b37a111bb4af0a8b060 (diff)
parent1f2baa78c61bc99fe82bc62fc6d5a8d307984f3d (diff)
downloadgit-6f49ed6153be9f37d48bdec4a036a8b8a5629590.tar.gz
git-6f49ed6153be9f37d48bdec4a036a8b8a5629590.tar.xz
Merge branch 'jk/missing-config'
* jk/missing-config: config: treat non-existent config files as empty
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-repo-config.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index d0ab8ffe1..d0e55465f 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -289,6 +289,14 @@ test_expect_success 'working --list' \
'git config --list > output && cmp output expect'
cat > expect << EOF
+EOF
+
+test_expect_success '--list without repo produces empty output' '
+ git --git-dir=nonexistent config --list >output &&
+ test_cmp expect output
+'
+
+cat > expect << EOF
beta.noindent sillyValue
nextsection.nonewline wow2 for me
EOF
@@ -836,6 +844,27 @@ test_expect_success SYMLINKS 'symlinked configuration' '
'
+test_expect_success 'nonexistent configuration' '
+ (
+ GIT_CONFIG=doesnotexist &&
+ export GIT_CONFIG &&
+ test_must_fail git config --list &&
+ test_must_fail git config test.xyzzy
+ )
+'
+
+test_expect_success SYMLINKS 'symlink to nonexistent configuration' '
+ ln -s doesnotexist linktonada &&
+ ln -s linktonada linktolinktonada &&
+ (
+ GIT_CONFIG=linktonada &&
+ export GIT_CONFIG &&
+ test_must_fail git config --list &&
+ GIT_CONFIG=linktolinktonada &&
+ test_must_fail git config --list
+ )
+'
+
test_expect_success 'check split_cmdline return' "
git config alias.split-cmdline-fix 'echo \"' &&
test_must_fail git split-cmdline-fix &&