Web lists-archives.com

[PATCH 15/19] replace-object: allow replace_object_pos to handle arbitrary repositories




Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
---
 replace-object.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/replace-object.c b/replace-object.c
index 944bcaf242..9272c7acbf 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -12,12 +12,10 @@ static const unsigned char *replace_sha1_access(size_t index, void *table)
 	return replace[index]->original;
 }
 
-#define replace_object_pos(r, s) \
-	replace_object_pos_##r(s)
-static int replace_object_pos_the_repository(const unsigned char *sha1)
+static int replace_object_pos(struct repository *r, const unsigned char *sha1)
 {
-	return sha1_pos(sha1,  the_repository->objects->replacements.items,
-			 the_repository->objects->replacements.nr,
+	return sha1_pos(sha1, r->objects->replacements.items,
+			r->objects->replacements.nr,
 			replace_sha1_access);
 }
 
-- 
2.17.0.484.g0c8726318c-goog