Skip to content

Commit 935cdd6

Browse files
stefanbellergitster
authored andcommitted
packfile: allow prepare_packed_git_one to handle arbitrary repositories
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 a49d283 commit 935cdd6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packfile.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ static void report_pack_garbage(struct string_list *list)
735735
report_helper(list, seen_bits, first, list->nr);
736736
}
737737

738-
#define prepare_packed_git_one(r, o, l) prepare_packed_git_one_##r(o, l)
739-
static void prepare_packed_git_one_the_repository(char *objdir, int local)
738+
static void prepare_packed_git_one(struct repository *r, char *objdir, int local)
740739
{
741740
struct strbuf path = STRBUF_INIT;
742741
size_t dirnamelen;
@@ -769,7 +768,7 @@ static void prepare_packed_git_one_the_repository(char *objdir, int local)
769768
base_len = path.len;
770769
if (strip_suffix_mem(path.buf, &base_len, ".idx")) {
771770
/* Don't reopen a pack we already have. */
772-
for (p = the_repository->objects->packed_git; p;
771+
for (p = r->objects->packed_git; p;
773772
p = p->next) {
774773
size_t len;
775774
if (strip_suffix(p->pack_name, ".pack", &len) &&
@@ -783,7 +782,7 @@ static void prepare_packed_git_one_the_repository(char *objdir, int local)
783782
* corresponding .pack file that we can map.
784783
*/
785784
(p = add_packed_git(path.buf, path.len, local)) != NULL)
786-
install_packed_git(the_repository, p);
785+
install_packed_git(r, p);
787786
}
788787

789788
if (!report_garbage)

0 commit comments

Comments
 (0)