git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org
Cc: pclouds@gmail.com, Stefan Beller <sbeller@google.com>
Subject: [PATCH 08/11] packfile: allow prepare_packed_git to handle arbitrary repositories
Date: Tue, 27 Feb 2018 17:06:05 -0800	[thread overview]
Message-ID: <20180228010608.215505-9-sbeller@google.com> (raw)
In-Reply-To: <20180228010608.215505-1-sbeller@google.com>

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 packfile.c | 18 +++++++++---------
 packfile.h |  3 +--
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/packfile.c b/packfile.c
index c45516acd41..9a3efc01555 100644
--- a/packfile.c
+++ b/packfile.c
@@ -883,19 +883,19 @@ static void prepare_packed_git_mru(struct repository *r)
 		list_add_tail(&p->mru, &r->objects.packed_git_mru);
 }
 
-void prepare_packed_git_the_repository(void)
+void prepare_packed_git(struct repository *r)
 {
 	struct alternate_object_database *alt;
 
-	if (the_repository->objects.packed_git_initialized)
+	if (r->objects.packed_git_initialized)
 		return;
-	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(the_repository, alt->path, 0);
-	rearrange_packed_git(the_repository);
-	prepare_packed_git_mru(the_repository);
-	the_repository->objects.packed_git_initialized = 1;
+	prepare_packed_git_one(r, get_object_directory(), 1);
+	prepare_alt_odb(r);
+	for (alt = r->objects.alt_odb_list; alt; alt = alt->next)
+		prepare_packed_git_one(r, alt->path, 0);
+	rearrange_packed_git(r);
+	prepare_packed_git_mru(r);
+	r->objects.packed_git_initialized = 1;
 }
 
 void reprepare_packed_git_the_repository(void)
diff --git a/packfile.h b/packfile.h
index 9afbf73657e..9142866c8ae 100644
--- a/packfile.h
+++ b/packfile.h
@@ -34,8 +34,7 @@ extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_
 #define PACKDIR_FILE_GARBAGE 4
 extern void (*report_garbage)(unsigned seen_bits, const char *path);
 
-#define prepare_packed_git(r) prepare_packed_git_##r()
-extern void prepare_packed_git_the_repository(void);
+extern void prepare_packed_git(struct repository *r);
 #define reprepare_packed_git(r) reprepare_packed_git_##r()
 extern void reprepare_packed_git_the_repository(void);
 extern void install_packed_git(struct repository *r, struct packed_git *pack);
-- 
2.16.2.395.g2e18187dfd-goog


  parent reply	other threads:[~2018-02-28  1:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  1:05 [PATCH 00/11] Moving global state into the repository object (part 2) Stefan Beller
2018-02-28  1:05 ` [PATCH 01/11] packfile: allow prepare_packed_git_mru to handle arbitrary repositories Stefan Beller
2018-02-28  1:05 ` [PATCH 02/11] packfile: allow rearrange_packed_git " Stefan Beller
2018-02-28  1:06 ` [PATCH 03/11] packfile: allow install_packed_git " Stefan Beller
2018-02-28 14:38   ` Derrick Stolee
2018-02-28  1:06 ` [PATCH 04/11] packfile: add repository argument to prepare_packed_git_one Stefan Beller
2018-02-28  1:06 ` [PATCH 05/11] packfile: add repository argument to prepare_packed_git Stefan Beller
2018-02-28  1:06 ` [PATCH 06/11] packfile: add repository argument to reprepare_packed_git Stefan Beller
2018-02-28  1:06 ` [PATCH 07/11] packfile: allow prepare_packed_git_one to handle arbitrary repositories Stefan Beller
2018-02-28  1:06 ` Stefan Beller [this message]
2018-02-28  1:06 ` [PATCH 09/11] packfile: allow reprepare_packed_git " Stefan Beller
2018-02-28  1:06 ` [PATCH 10/11] packfile: add repository argument to find_pack_entry Stefan Beller
2018-02-28  1:06 ` [PATCH 11/11] packfile: allow find_pack_entry to handle arbitrary repositories Stefan Beller
2018-02-28  2:15 ` [PATCH 00/11] Moving global state into the repository object (part 2) Duy Nguyen
2018-02-28 14:47   ` Derrick Stolee
2018-02-28 17:59   ` Junio C Hamano
2018-02-28 18:59     ` Stefan Beller
2018-02-28 19:09       ` Junio C Hamano
2018-02-28 17:57 ` Junio C Hamano
2018-02-28 18:56   ` Stefan Beller
2018-02-28 19:19     ` Jonathan Nieder
2018-02-28 19:02   ` Junio C Hamano
2018-02-28 19:09     ` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180228010608.215505-9-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).