From: Stefan Beller Date: Mon, 05 Feb 2018 23:54:48 GMT Subject: [PATCH 027/194] pack: allow install_packed_git to handle arbitrary repositories Message-ID: <20180205235735.216710-7-sbeller@google.com> In-Reply-To: <20180205235735.216710-1-sbeller@google.com> From: Jonathan Nieder Signed-off-by: Stefan Beller Signed-off-by: Jonathan Nieder --- packfile.c | 6 +++--- packfile.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packfile.c b/packfile.c index 6a1c8107ed..05b4505b2c 100644 --- a/packfile.c +++ b/packfile.c @@ -671,13 +671,13 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local) return p; } -void install_packed_git_the_repository(struct packed_git *pack) +void install_packed_git(struct repository *r, struct packed_git *pack) { if (pack->pack_fd != -1) pack_open_fds++; - pack->next = the_repository->objects.packed_git; - the_repository->objects.packed_git = pack; + pack->next = r->objects.packed_git; + r->objects.packed_git = pack; } void (*report_garbage)(unsigned seen_bits, const char *path); diff --git a/packfile.h b/packfile.h index 74f293c439..ba6f08be99 100644 --- a/packfile.h +++ b/packfile.h @@ -36,8 +36,7 @@ extern void (*report_garbage)(unsigned seen_bits, const char *path); extern void prepare_packed_git_the_repository(void); #define reprepare_packed_git(r) reprepare_packed_git_##r() extern void reprepare_packed_git_the_repository(void); -#define install_packed_git(r, p) install_packed_git_##r(p) -extern void install_packed_git_the_repository(struct packed_git *pack); +extern void install_packed_git(struct repository *r, struct packed_git *pack); /* * Give a rough count of objects in the repository. This sacrifices accuracy -- 2.15.1.433.g936d1b9894.dirty