Add a repository argument to allow the prepare_packed_git_mru 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: Stefan Beller <sbel...@google.com>
Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
---
 packfile.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/packfile.c b/packfile.c
index 1d03bf48b4..6a04e4bb1b 100644
--- a/packfile.c
+++ b/packfile.c
@@ -858,7 +858,8 @@ static void rearrange_packed_git_the_repository(void)
                set_next_packed_git, sort_pack);
 }
 
-static void prepare_packed_git_mru(void)
+#define prepare_packed_git_mru(r) prepare_packed_git_mru_##r()
+static void prepare_packed_git_mru_the_repository(void)
 {
        struct packed_git *p;
 
@@ -878,7 +879,7 @@ void prepare_packed_git(void)
        for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next)
                prepare_packed_git_one(the_repository, alt->path, 0);
        rearrange_packed_git(the_repository);
-       prepare_packed_git_mru();
+       prepare_packed_git_mru(the_repository);
        the_repository->objects.packed_git_initialized = 1;
 }
 
-- 
2.14.1.581.gf28d330327

Reply via email to