environment: move access to "core.bigFileThreshold" into repo settings
The "core.bigFileThreshold" setting is stored in a global variable and populated via `git_default_core_config()`. This may cause issues in the case where one is handling multiple different repositories in a single process with different values for that config key, as we may or may not see the correct value in that case. Furthermore, global state blocks our path towards libification. Refactor the code so that we instead store the value in `struct repo_settings`, where the value is computed as-needed and cached. Note that this change requires us to adapt one test in t1050 that verifies that we die when parsing an invalid "core.bigFileThreshold" value. The exercised Git command doesn't use the value at all, and thus it won't hit the new code path that parses the value. This is addressed by using git-hash-object(1) instead, which does read the value. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2582846f2f
commit
7835ee75cd
@@ -431,7 +431,8 @@ static int istream_source(struct git_istream *st,
|
||||
st->open = open_istream_loose;
|
||||
return 0;
|
||||
case OI_PACKED:
|
||||
if (!oi.u.packed.is_delta && big_file_threshold < size) {
|
||||
if (!oi.u.packed.is_delta &&
|
||||
repo_settings_get_big_file_threshold(the_repository) < size) {
|
||||
st->u.in_pack.pack = oi.u.packed.pack;
|
||||
st->u.in_pack.pos = oi.u.packed.offset;
|
||||
st->open = open_istream_pack_non_delta;
|
||||
|
||||
Reference in New Issue
Block a user