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:18 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-26 20:07:43 +0300
commit5babff16d9efdef8c3224d386db0b8ab2a0930d5 (patch)
tree0c479ce8d74b1bf008981d4bec6d4d2b709e54ef /packfile.c
parentc235beac4e51ce7ebfefe6c9c38d3b8906222ed2 (diff)
packfile: allow install_packed_git to handle arbitrary repositories
This conversion was done without the #define trick used in the earlier series refactoring to have better repository access, because this function is easy to review, as it only has one caller and all lines but the first two are converted. We must not convert 'pack_open_fds' to be a repository specific variable, as it is used to monitor resource usage of the machine that Git executes on. 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packfile.c b/packfile.c
index 326c171e98..94987634e5 100644
--- a/packfile.c
+++ b/packfile.c
@@ -680,13 +680,13 @@ struct packed_git *add_packed_git(const char *path, size_t path_len, int local)
return p;
}
-void install_packed_git(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);
@@ -782,7 +782,7 @@ static void prepare_packed_git_one(char *objdir, int local)
* corresponding .pack file that we can map.
*/
(p = add_packed_git(path.buf, path.len, local)) != NULL)
- install_packed_git(p);
+ install_packed_git(the_repository, p);
}
if (!report_garbage)