Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-23 20:45:26 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-26 20:07:43 +0300
commit0a0dd632aa9c9bcdb1b79a7fc4cf6dc161760020 (patch)
tree7e6d7440bead5d3e027543a74ed78745234824c9 /packfile.c
parent613b42f283140308435939377994c4d57d0dda23 (diff)
packfile: allow find_pack_entry to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/packfile.c b/packfile.c
index 9df123f0f1..5d4c8d6e57 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1845,19 +1845,18 @@ static int fill_pack_entry(const unsigned char *sha1,
return 1;
}
-int find_pack_entry_the_repository(const unsigned char *sha1, struct pack_entry *e)
+int find_pack_entry(struct repository *r, const unsigned char *sha1, struct pack_entry *e)
{
struct list_head *pos;
- prepare_packed_git(the_repository);
- if (!the_repository->objects->packed_git)
+ prepare_packed_git(r);
+ if (!r->objects->packed_git)
return 0;
- list_for_each(pos, &the_repository->objects->packed_git_mru) {
+ list_for_each(pos, &r->objects->packed_git_mru) {
struct packed_git *p = list_entry(pos, struct packed_git, mru);
if (fill_pack_entry(sha1, e, p)) {
- list_move(&p->mru,
- &the_repository->objects->packed_git_mru);
+ list_move(&p->mru, &r->objects->packed_git_mru);
return 1;
}
}