Skip to content

Commit fe6d34d

Browse files
stefanbellergitster
authored andcommitted
replace-object: add repository argument to prepare_replace_object
Add a repository argument to allow the prepare_replace_object caller 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>
1 parent 60ce76d commit fe6d34d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

replace_object.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ static int register_replace_ref(const char *refname,
3131
return 0;
3232
}
3333

34-
static void prepare_replace_object(void)
34+
#define prepare_replace_object(r) \
35+
prepare_replace_object_##r()
36+
static void prepare_replace_object_the_repository(void)
3537
{
3638
if (the_repository->objects->replace_map)
3739
return;
@@ -58,7 +60,7 @@ const struct object_id *do_lookup_replace_object(const struct object_id *oid)
5860
int depth = MAXREPLACEDEPTH;
5961
const struct object_id *cur = oid;
6062

61-
prepare_replace_object();
63+
prepare_replace_object(the_repository);
6264

6365
/* Try to recursively replace the object */
6466
while (depth-- > 0) {

0 commit comments

Comments
 (0)