summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-14 13:59:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-16 02:54:01 (GMT)
commit44004872c891ae1b06cd3aff9c597828558ddedb (patch)
tree31b2397f49e02ec1bd741cdce0fd25b6ee725b47 /config.c
parentd166e6afe5f257217836ef24a73764eba390c58d (diff)
downloadgit-44004872c891ae1b06cd3aff9c597828558ddedb.zip
git-44004872c891ae1b06cd3aff9c597828558ddedb.tar.gz
git-44004872c891ae1b06cd3aff9c597828558ddedb.tar.bz2
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 2ffd39c..04286f7 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;