Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
packfile: allow prepare_packed_git_one to handle arbitrary repositories
author
Stefan Beller
<sbeller@google.com>
Fri, 23 Mar 2018 17:45:22 +0000
(18:45 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 26 Mar 2018 17:07:43 +0000
(10:07 -0700)
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>
packfile.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a49d283
)
diff --git
a/packfile.c
b/packfile.c
index 210fcb3db4c016ff06e26f4e673ba8c87c434433..fd6aa54b4bd90c5a24cc1f20d0e79ce0a709baac 100644
(file)
--- a/
packfile.c
+++ b/
packfile.c
@@
-735,8
+735,7
@@
static void report_pack_garbage(struct string_list *list)
report_helper(list, seen_bits, first, list->nr);
}
report_helper(list, seen_bits, first, list->nr);
}
-#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)
+static void prepare_packed_git_one(struct repository *r, char *objdir, int local)
{
struct strbuf path = STRBUF_INIT;
size_t dirnamelen;
{
struct strbuf path = STRBUF_INIT;
size_t dirnamelen;
@@
-769,7
+768,7
@@
static void prepare_packed_git_one_the_repository(char *objdir, int local)
base_len = path.len;
if (strip_suffix_mem(path.buf, &base_len, ".idx")) {
/* Don't reopen a pack we already have. */
base_len = path.len;
if (strip_suffix_mem(path.buf, &base_len, ".idx")) {
/* Don't reopen a pack we already have. */
- for (p =
the_repository
->objects->packed_git; p;
+ for (p =
r
->objects->packed_git; p;
p = p->next) {
size_t len;
if (strip_suffix(p->pack_name, ".pack", &len) &&
p = p->next) {
size_t len;
if (strip_suffix(p->pack_name, ".pack", &len) &&
@@
-783,7
+782,7
@@
static void prepare_packed_git_one_the_repository(char *objdir, int local)
* corresponding .pack file that we can map.
*/
(p = add_packed_git(path.buf, path.len, local)) != NULL)
* corresponding .pack file that we can map.
*/
(p = add_packed_git(path.buf, path.len, local)) != NULL)
- install_packed_git(
the_repository
, p);
+ install_packed_git(
r
, p);
}
if (!report_garbage)
}
if (!report_garbage)