diff options
author | Stefan Beller <sbeller@google.com> | 2018-03-23 20:45:20 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-26 20:07:43 +0300 |
commit | 6fdb4e9f5a883aa3d96fc19b3e08d3449d53ea0c (patch) | |
tree | f053cf8da99db90dd4a031188022dc9aa048014c /packfile.c | |
parent | 072a109356a8d3563b091efcecb2a201edc0de63 (diff) |
packfile: add repository argument to prepare_packed_git
Add a repository argument to allow prepare_packed_git callers to be
more specific about which repository to handle. See commit "sha1_file:
add repository argument to link_alt_odb_entry" for an explanation of
the #define trick.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r-- | packfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packfile.c b/packfile.c index b789d0f0a3..6b2c86c5e0 100644 --- a/packfile.c +++ b/packfile.c @@ -817,7 +817,7 @@ unsigned long approximate_object_count(void) unsigned long count; struct packed_git *p; - prepare_packed_git(); + prepare_packed_git(the_repository); count = 0; for (p = the_repository->objects->packed_git; p; p = p->next) { if (open_pack_index(p)) @@ -884,7 +884,7 @@ static void prepare_packed_git_mru(struct repository *r) list_add_tail(&p->mru, &r->objects->packed_git_mru); } -void prepare_packed_git(void) +void prepare_packed_git_the_repository(void) { struct alternate_object_database *alt; @@ -903,7 +903,7 @@ void reprepare_packed_git(void) { the_repository->objects->approximate_object_count_valid = 0; the_repository->objects->packed_git_initialized = 0; - prepare_packed_git(); + prepare_packed_git(the_repository); } struct packed_git *get_packed_git(struct repository *r) @@ -1854,7 +1854,7 @@ int find_pack_entry(const unsigned char *sha1, struct pack_entry *e) { struct list_head *pos; - prepare_packed_git(); + prepare_packed_git(the_repository); if (!the_repository->objects->packed_git) return 0; @@ -1908,7 +1908,7 @@ int for_each_packed_object(each_packed_object_fn cb, void *data, unsigned flags) int r = 0; int pack_errors = 0; - prepare_packed_git(); + prepare_packed_git(the_repository); for (p = the_repository->objects->packed_git; p; p = p->next) { if ((flags & FOR_EACH_OBJECT_LOCAL_ONLY) && !p->pack_local) continue; |