Skip to content

Commit 4400487

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d166e6a commit 4400487

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,8 @@ static int do_git_config_sequence(const struct config_options *opts,
16681668

16691669
if (opts->commondir)
16701670
repo_config = mkpathdup("%s/config", opts->commondir);
1671+
else if (opts->git_dir)
1672+
BUG("git_dir without commondir");
16711673
else
16721674
repo_config = NULL;
16731675

0 commit comments

Comments
 (0)