diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-06-06 16:24:35 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-12 23:34:55 +0300 |
commit | d24eda4e03cabbd39ce06827d47e52a97b9095db (patch) | |
tree | f98b63713141bd006322705529965c3ed69e63e5 /replace-object.c | |
parent | b0afdce5dab61f224fd66c13768facc36a7f8705 (diff) |
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 'replace-object.c')
-rw-r--r-- | replace-object.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/replace-object.c b/replace-object.c index e98825d585..ceec81c940 100644 --- a/replace-object.c +++ b/replace-object.c @@ -84,3 +84,8 @@ const struct object_id *do_lookup_replace_object(struct repository *r, } die(_("replace depth too high for object %s"), oid_to_hex(oid)); } + +void disable_replace_refs(void) +{ + read_replace_refs = 0; +} |