diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2017-08-30 00:03:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-07 08:49:45 +0900 |
commit | c23761b57324b35d84210867e02c7e9de6f633a4 (patch) | |
tree | 1ec05f7108bad1fa603a4c0b3e260a8419586533 | |
parent | 9da1128049b04d9088c94e512c2a8bf9d6ccf403 (diff) | |
download | git-c23761b57324b35d84210867e02c7e9de6f633a4.tar.gz |
pack: add repository argument to prepare_packed_git_one
Add a repository argument to allow the prepare_packed_git_one caller
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.
As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | packfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packfile.c b/packfile.c index cea3698af5..3a841c0f69 100644 --- a/packfile.c +++ b/packfile.c @@ -719,7 +719,8 @@ static void report_pack_garbage(struct string_list *list) report_helper(list, seen_bits, first, list->nr); } -static void prepare_packed_git_one(char *objdir, int local) +#define prepare_packed_git_one(r, o, l) prepare_packed_git_one_##r(o, l) +static void prepare_packed_git_one_the_repository(char *objdir, int local) { struct strbuf path = STRBUF_INIT; size_t dirnamelen; @@ -871,10 +872,10 @@ void prepare_packed_git(void) if (the_repository->objects.packed_git_initialized) return; - prepare_packed_git_one(get_object_directory(), 1); + prepare_packed_git_one(the_repository, get_object_directory(), 1); prepare_alt_odb(the_repository); for (alt = the_repository->objects.alt_odb_list; alt; alt = alt->next) - prepare_packed_git_one(alt->path, 0); + prepare_packed_git_one(the_repository, alt->path, 0); rearrange_packed_git(); prepare_packed_git_mru(); the_repository->objects.packed_git_initialized = 1; |