]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
config: stop checking whether the_repository is NULL
authorJeff King <peff@peff.net>
Tue, 6 Aug 2019 12:27:58 +0000 (08:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Aug 2019 20:09:01 +0000 (13:09 -0700)
commit22932d9169fea7c826c85e2407054feff30ebaf1
tree109017e88b8163070c2df39c001fbb7be0dd5385
parent5732f2b1ef3559f2b2a5c67302f8bf21846488bc
config: stop checking whether the_repository is NULL

Since the previous commit, our invariant that the_repository is never
NULL is restored, and we can stop being defensive in include_by_branch().

We can confirm the fix by showing that an onbranch config include will
not cause a segfault when run outside a git repository. I've put this in
t1309-early-config since it's related to the case added by 85fe0e800c
(config: work around bug with includeif:onbranch and early config,
2019-07-31), though technically the issue was with
read_very_early_config() and not read_early_config().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c
t/t1309-early-config.sh