git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 08/11] packfile: allow prepare_packed_git to handle arbitrary repositories

From
Stefan Beller <sbeller@google.com>
Date
Feb 28, 2018, 01:06 UTC
Message-ID
<20180228010608.215505-9-sbeller@google.com>
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
Previous: Stefan BellerNext: Stefan Beller
Message 8 of 23 in “Moving global state into the repository object (part 2)”
  1. 00/11 Moving global state into the repository object (part 2)Stefan Beller, Feb 28, 2018
  2. 01/11 packfile: allow prepare_packed_git_mru to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  3. 02/11 packfile: allow rearrange_packed_git to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  4. 03/11 packfile: allow install_packed_git to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  5. Derrick StoleeFeb 28, 2018
  6. 05/11 packfile: add repository argument to prepare_packed_gitStefan Beller, Feb 28, 2018
  7. 07/11 packfile: allow prepare_packed_git_one to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  8. 08/11 packfile: allow prepare_packed_git to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  9. 06/11 packfile: add repository argument to reprepare_packed_gitStefan Beller, Feb 28, 2018
  10. 11/11 packfile: allow find_pack_entry to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  11. 04/11 packfile: add repository argument to prepare_packed_git_oneStefan Beller, Feb 28, 2018
  12. 09/11 packfile: allow reprepare_packed_git to handle arbitrary repositoriesStefan Beller, Feb 28, 2018
  13. 10/11 packfile: add repository argument to find_pack_entryStefan Beller, Feb 28, 2018
  14. Duy NguyenFeb 28, 2018
  15. Derrick StoleeFeb 28, 2018
  16. Junio C HamanoFeb 28, 2018
  17. Stefan BellerFeb 28, 2018
  18. Junio C HamanoFeb 28, 2018
  19. Junio C HamanoFeb 28, 2018
  20. Stefan BellerFeb 28, 2018
  21. Jonathan NiederFeb 28, 2018
  22. Junio C HamanoFeb 28, 2018
  23. Stefan BellerFeb 28, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.