summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c2
-rwxr-xr-xt/t1300-repo-config.sh8
2 files changed, 9 insertions, 1 deletions
diff --git a/config.c b/config.c
index 84ff346859..2567b546a3 100644
--- a/config.c
+++ b/config.c
@@ -858,7 +858,7 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)
switch (git_config_from_parameters(fn, data)) {
case -1: /* error */
- ret--;
+ die("unable to parse command-line config");
break;
case 0: /* found nothing */
break;
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index ca5058e0d4..584e956ac5 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -910,4 +910,12 @@ test_expect_success 'git -c does not split values on equals' '
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_done