summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-14 14:59:02 +0100
committerJunio C Hamano <gitster@pobox.com>2018-11-16 03:54:01 +0100
commit44004872c891ae1b06cd3aff9c597828558ddedb (patch)
tree31b2397f49e02ec1bd741cdce0fd25b6ee725b47 /config.c
parentTenth batch for 2.20 (diff)
downloadgit-44004872c891ae1b06cd3aff9c597828558ddedb.tar.xz
git-44004872c891ae1b06cd3aff9c597828558ddedb.zip
config: report a bug if git_dir exists without commondir
This did happen at some stage, and was fixed relatively quickly. Make sure that we detect very quickly, too, should that happen again. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/config.c b/config.c
index 2ffd39c220..04286f7717 100644
--- a/config.c
+++ b/config.c
@@ -1668,6 +1668,8 @@ static int do_git_config_sequence(const struct config_options *opts,
if (opts->commondir)
repo_config = mkpathdup("%s/config", opts->commondir);
+ else if (opts->git_dir)
+ BUG("git_dir without commondir");
else
repo_config = NULL;