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>
Johannes Schindelin committed
Nov 14, 2018 at 05:59 UTC
44004872c891ae1b06cd3aff9c597828558ddedb
1 file changed
+2
config.c
+2
@@ -1668,6 +1668,8 @@ static int do_git_config_sequence(const struct config_options *opts,
1668
1669
if (opts->commondir)
1670
repo_config = mkpathdup("%s/config", opts->commondir);
1671
+ else if (opts->git_dir)
1672
+ BUG("git_dir without commondir");
1673
else
1674
repo_config = NULL;
1675