summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-23 18:45:16 +0100
committerJunio C Hamano <gitster@pobox.com>2018-03-26 10:07:43 -0700
commit804be79690287e2fdb95f4ce66504f9aed5dcf8f (patch)
tree0cb7e785756b2f5254932d1533a0eec112aec845
parent4a7c05f7d7f17cd7a42fa944e79c2ef294cb17b6 (diff)
downloadgit-804be79690287e2fdb95f4ce66504f9aed5dcf8f.tar.gz
git-804be79690287e2fdb95f4ce66504f9aed5dcf8f.zip
packfile: allow prepare_packed_git_mru to handle arbitrary repositories
This conversion was done without the #define trick used in the earlier series refactoring to have better repository access, because this function is easy to review, as all lines are converted and it has only one caller Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--packfile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/packfile.c b/packfile.c
index d087eacc06..e954b575c3 100644
--- a/packfile.c
+++ b/packfile.c
@@ -873,14 +873,14 @@ static void rearrange_packed_git(void)
set_next_packed_git, sort_pack);
}
-static void prepare_packed_git_mru(void)
+static void prepare_packed_git_mru(struct repository *r)
{
struct packed_git *p;
- INIT_LIST_HEAD(&the_repository->objects->packed_git_mru);
+ INIT_LIST_HEAD(&r->objects->packed_git_mru);
- for (p = the_repository->objects->packed_git; p; p = p->next)
- list_add_tail(&p->mru, &the_repository->objects->packed_git_mru);
+ for (p = r->objects->packed_git; p; p = p->next)
+ list_add_tail(&p->mru, &r->objects->packed_git_mru);
}
void prepare_packed_git(void)
@@ -894,7 +894,7 @@ void prepare_packed_git(void)
for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next)
prepare_packed_git_one(alt->path, 0);
rearrange_packed_git();
- prepare_packed_git_mru();
+ prepare_packed_git_mru(the_repository);
the_repository->objects->packed_git_initialized = 1;
}