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>
This commit is contained in:

committed by
Junio C Hamano

parent
b0afdce5da
commit
d24eda4e03
@ -805,7 +805,7 @@ static int batch_objects(struct batch_options *opt)
|
||||
if (repo_has_promisor_remote(the_repository))
|
||||
warning("This repository uses promisor remotes. Some objects may not be loaded.");
|
||||
|
||||
read_replace_refs = 0;
|
||||
disable_replace_refs();
|
||||
|
||||
cb.opt = opt;
|
||||
cb.expand = &data;
|
||||
|
Reference in New Issue
Block a user