diff options
author | Jeff King <peff@peff.net> | 2019-08-06 14:27:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-06 22:09:01 +0200 |
commit | 22932d9169fea7c826c85e2407054feff30ebaf1 (patch) | |
tree | 109017e88b8163070c2df39c001fbb7be0dd5385 /t/t1309-early-config.sh | |
parent | common-main: delay trace2 initialization (diff) | |
download | git-22932d9169fea7c826c85e2407054feff30ebaf1.tar.xz git-22932d9169fea7c826c85e2407054feff30ebaf1.zip |
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>
Diffstat (limited to 't/t1309-early-config.sh')
-rwxr-xr-x | t/t1309-early-config.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t1309-early-config.sh b/t/t1309-early-config.sh index eeb60e4143..3a0de0ddaa 100755 --- a/t/t1309-early-config.sh +++ b/t/t1309-early-config.sh @@ -94,4 +94,9 @@ test_expect_success 'early config and onbranch' ' test_with_config "[includeif \"onbranch:master\"]path=../broken" ' +test_expect_success 'onbranch config outside of git repo' ' + test_config_global includeIf.onbranch:master.path non-existent && + nongit git help +' + test_done |