Skip to content

Commit 804be79

Browse files
stefanbellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4a7c05f commit 804be79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packfile.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -873,14 +873,14 @@ static void rearrange_packed_git(void)
873873
set_next_packed_git, sort_pack);
874874
}
875875

876-
static void prepare_packed_git_mru(void)
876+
static void prepare_packed_git_mru(struct repository *r)
877877
{
878878
struct packed_git *p;
879879

880-
INIT_LIST_HEAD(&the_repository->objects->packed_git_mru);
880+
INIT_LIST_HEAD(&r->objects->packed_git_mru);
881881

882-
for (p = the_repository->objects->packed_git; p; p = p->next)
883-
list_add_tail(&p->mru, &the_repository->objects->packed_git_mru);
882+
for (p = r->objects->packed_git; p; p = p->next)
883+
list_add_tail(&p->mru, &r->objects->packed_git_mru);
884884
}
885885

886886
void prepare_packed_git(void)
@@ -894,7 +894,7 @@ void prepare_packed_git(void)
894894
for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next)
895895
prepare_packed_git_one(alt->path, 0);
896896
rearrange_packed_git();
897-
prepare_packed_git_mru();
897+
prepare_packed_git_mru(the_repository);
898898
the_repository->objects->packed_git_initialized = 1;
899899
}
900900

0 commit comments

Comments
 (0)