From: Johannes Schindelin Date: Wed, 14 Nov 2018 13:59:02 +0000 (-0800) Subject: config: report a bug if git_dir exists without commondir X-Git-Tag: v2.20.0-rc0~9^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/44004872c891ae1b06cd3aff9c597828558ddedb?ds=inline;hp=--cc 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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- 44004872c891ae1b06cd3aff9c597828558ddedb 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;