]> git.ipfire.org Git - thirdparty/git.git/commit - environment.c
repository: create disable_replace_refs()
authorDerrick Stolee <derrickstolee@github.com>
Tue, 6 Jun 2023 13:24:35 +0000 (13:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jun 2023 20:34:55 +0000 (13:34 -0700)
commitd24eda4e03cabbd39ce06827d47e52a97b9095db
treef98b63713141bd006322705529965c3ed69e63e5
parentb0afdce5dab61f224fd66c13768facc36a7f8705
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>
13 files changed:
builtin/cat-file.c
builtin/commit-graph.c
builtin/fsck.c
builtin/index-pack.c
builtin/pack-objects.c
builtin/prune.c
builtin/replace.c
builtin/unpack-objects.c
builtin/upload-pack.c
environment.c
git.c
replace-object.c
replace-object.h