Code

Merge branch 'jm/mergetool-pathspec' into maint-1.7.6
[git.git] / t / t1300-repo-config.sh
index 53fb8228cf18e2b58f3ea63e98a0220fa0fd39f2..3e140c18f4183c41c76aaab0834f1d23ce7bcd2d 100755 (executable)
@@ -897,4 +897,29 @@ test_expect_success 'key sanity-checking' '
        git config foo."ba =z".bar false
 '
 
+test_expect_success 'git -c works with aliases of builtins' '
+       git config alias.checkconfig "-c foo.check=bar config foo.check" &&
+       echo bar >expect &&
+       git checkconfig >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'git -c does not split values on equals' '
+       echo "value with = in it" >expect &&
+       git -c core.foo="value with = in it" config core.foo >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'git -c dies on bogus config' '
+       test_must_fail git -c core.bare=foo rev-parse
+'
+
+test_expect_success 'git -c complains about empty key' '
+       test_must_fail git -c "=foo" rev-parse
+'
+
+test_expect_success 'git -c complains about empty key and value' '
+       test_must_fail git -c "" rev-parse
+'
+
 test_done