refs: add repository argument to for_each_replace_ref

Add a repository argument to allow for_each_replace_ref callers to be
more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2018-04-11 17:21:10 -07:00
committed by Junio C Hamano
parent 23a3f0cb16
commit 60ce76d358
4 changed files with 8 additions and 4 deletions

View File

@ -40,7 +40,7 @@ static void prepare_replace_object(void)
xmalloc(sizeof(*the_repository->objects->replace_map));
oidmap_init(the_repository->objects->replace_map, 0);
for_each_replace_ref(register_replace_ref, NULL);
for_each_replace_ref(the_repository, register_replace_ref, NULL);
}
/* We allow "recursive" replacement. Only within reason, though */