diff options
| author | Derrick Stolee <derrickstolee@github.com> | 2023-06-06 13:24:35 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-06-12 13:34:55 -0700 |
| commit | d24eda4e03cabbd39ce06827d47e52a97b9095db (patch) | |
| tree | f98b63713141bd006322705529965c3ed69e63e5 /builtin/fsck.c | |
| parent | b0afdce5dab61f224fd66c13768facc36a7f8705 (diff) | |
| download | git-d24eda4e03cabbd39ce06827d47e52a97b9095db.tar.xz | |
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/fsck.c')
| -rw-r--r-- | builtin/fsck.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index 2cd461b84c..a2fe760cc0 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -927,7 +927,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) fetch_if_missing = 0; errors_found = 0; - read_replace_refs = 0; + disable_replace_refs(); save_commit_buffer = 0; argc = parse_options(argc, argv, prefix, fsck_opts, fsck_usage, 0); |
