Merge branch 'js/config-sequence'
authorJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:57 +0000 (18:23 +0900)
A sanity check for start-up sequence has been added in the config
API codepath.

* js/config-sequence:
config: report a bug if git_dir exists without commondir

config.c
index 2ffd39c22006beaf8c4b0941d82183dd3b756955..04286f7717645c6812c7236a282c34f5ad353eb7 100644 (file)
--- 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;