Subject: [PATCH 34/44] packfile: allow rearrange_packed_git to handle arbitrary repositories

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sat, 3 Mar 2018 18:36:27 +0700

From: Stefan Beller <[email-masked]>

Signed-off-by: Stefan Beller <[email-masked]>
Signed-off-by: Junio C Hamano <[email-masked]>
Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 packfile.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/packfile.c b/packfile.c
index 0eaf5ee100..5356712717 100644
--- a/packfile.c
+++ b/packfile.c
@@ -865,10 +865,10 @@ static int sort_pack(const void *a_, const void *b_)
 	return -1;
 }
 
-static void rearrange_packed_git(void)
+static void rearrange_packed_git(struct repository *r)
 {
-	the_repository->objects.packed_git = llist_mergesort(
-		the_repository->objects.packed_git, get_next_packed_git,
+	r->objects.packed_git = llist_mergesort(
+		r->objects.packed_git, get_next_packed_git,
 		set_next_packed_git, sort_pack);
 }
 
@@ -892,7 +892,7 @@ void prepare_packed_git(void)
 	prepare_alt_odb(the_repository);
 	for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next)
 		prepare_packed_git_one(alt->path, 0);
-	rearrange_packed_git();
+	rearrange_packed_git(the_repository);
 	prepare_packed_git_mru(the_repository);
 	the_repository->objects.packed_git_initialized = 1;
 }
-- 
2.16.1.435.g8f24da2e1a