diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-06-06 15:24:35 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-12 22:34:55 +0200 |
commit | d24eda4e03cabbd39ce06827d47e52a97b9095db (patch) | |
tree | f98b63713141bd006322705529965c3ed69e63e5 /builtin/pack-objects.c | |
parent | pack-bitmap.c: use commit boundary during bitmap traversal (diff) | |
download | git-d24eda4e03cabbd39ce06827d47e52a97b9095db.tar.xz git-d24eda4e03cabbd39ce06827d47e52a97b9095db.zip |
repository: create disable_replace_refs()
Several builtins depend on being able to disable the replace references
so we actually operate on each object individually. These currently do
so by directly mutating the 'read_replace_refs' global.
A future change will move this global into a different place, so it will
be necessary to change all of these lines. However, we can simplify that
transition by abstracting the purpose of these global assignments with a
method call.
We will need to keep this read_replace_refs global forever, as we want
to make sure that we never use replace refs throughout the life of the
process if this method is called. Future changes may present a
repository-scoped version of the variable to represent that repository's
core.useReplaceRefs config value, but a zero-valued read_replace_refs
will always override such a setting.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r-- | builtin/pack-objects.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index a5b466839b..e23fe82ca1 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -4284,7 +4284,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) if (DFS_NUM_STATES > (1 << OE_DFS_STATE_BITS)) BUG("too many dfs states, increase OE_DFS_STATE_BITS"); - read_replace_refs = 0; + disable_replace_refs(); sparse = git_env_bool("GIT_TEST_PACK_SPARSE", -1); if (the_repository->gitdir) { |