]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1300-repo-config.sh
git_config_push_parameter: handle empty GIT_CONFIG_PARAMETERS
[thirdparty/git.git] / t / t1300-repo-config.sh
index 52678e7d0ac754bb678eb7c7a9203bc253085366..c96774030475ff2006477106946946107ead39ed 100755 (executable)
@@ -1083,6 +1083,20 @@ test_expect_success 'git -c complains about empty key and value' '
        test_must_fail git -c "" rev-parse
 '
 
+test_expect_success 'multiple git -c appends config' '
+       test_config alias.x "!git -c x.two=2 config --get-regexp ^x\.*" &&
+       cat >expect <<-\EOF &&
+       x.one 1
+       x.two 2
+       EOF
+       git -c x.one=1 x >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'git -c is not confused by empty environment' '
+       GIT_CONFIG_PARAMETERS="" git -c x.one=1 config --list
+'
+
 test_expect_success 'git config --edit works' '
        git config -f tmp test.value no &&
        echo test.value=yes >expect &&