[PATCH 027/194] pack: allow install_packed_git to handle arbitrary repositories
From: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
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