object: stop depending on the_repository
There are a couple of functions exposed by "object.c" that implicitly depend on `the_repository`. Remove this dependency by injecting the repository via a parameter. Adapt callers accordingly by simply using `the_repository`, except in cases where the subsystem is already free of the repository. In that case, we instead pass the repository provided by the caller's context. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
228457c9d9
commit
74d414c9f1
@@ -279,14 +279,14 @@ static unsigned check_objects(void)
|
||||
{
|
||||
unsigned i, max, foreign_nr = 0;
|
||||
|
||||
max = get_max_object_index();
|
||||
max = get_max_object_index(the_repository);
|
||||
|
||||
if (verbose)
|
||||
progress = start_delayed_progress(the_repository,
|
||||
_("Checking objects"), max);
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
foreign_nr += check_object(get_indexed_object(i));
|
||||
foreign_nr += check_object(get_indexed_object(the_repository, i));
|
||||
display_progress(progress, i + 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user