From: Jonathan Nieder <jrnie...@gmail.com>

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 52cf9182c4..b4ace96f0c 100644
--- a/packfile.c
+++ b/packfile.c
@@ -865,7 +865,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;
 
@@ -885,7 +886,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.15.1.433.g936d1b9894.dirty

Reply via email to