diff options
-rw-r--r-- | config.c | 2 | ||||
-rwxr-xr-x | t/t1300-repo-config.sh | 8 |
2 files changed, 9 insertions, 1 deletions
@@ -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 |