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

[PATCH 37/39] pack: allow map_sha1_file_1 to handle arbitrary repositories

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 30, 2017, 07:16 UTC
Message-ID
<20170830071632.GL153983@aiede.mtv.corp.google.com>
In-Reply-To
<20170830064634.GA153983@aiede.mtv.corp.google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 sha1_file.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 930705f59b..7fc5ebf2af 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -876,10 +876,8 @@ static int open_sha1_file(struct repository *r,
  * Map the loose object at "path" if it is not NULL, or the path found by
  * searching for a loose object named "sha1".
  */
-#define map_sha1_file_1(r, p, s, si) map_sha1_file_1_##r(p, s, si)
-static void *map_sha1_file_1_the_repository(const char *path,
-					    const unsigned char *sha1,
-					    unsigned long *size)
+static void *map_sha1_file_1(struct repository *r, const char *path,
+			     const unsigned char *sha1, unsigned long *size)
 {
 	void *map;
 	int fd;
@@ -887,7 +885,7 @@ static void *map_sha1_file_1_the_repository(const char *path,
 	if (path)
 		fd = git_open(path);
 	else
-		fd = open_sha1_file(the_repository, sha1, &path);
+		fd = open_sha1_file(r, sha1, &path);
 	map = NULL;
 	if (fd >= 0) {
 		struct stat st;
-- 
2.14.1.581.gf28d330327
Previous: Jonathan NiederNext: Jonathan Nieder
Message 43 of 46 in “per-repository object store, part 1”
  1. 00/39 per-repository object store, part 1Jonathan Nieder, Aug 30, 2017
  2. 01/39 pack: make packed_git_mru global a value instead of a pointerJonathan Nieder, Aug 30, 2017
  3. Jeff KingAug 30, 2017
  4. Junio C HamanoSep 6, 2017
  5. 02/39 repository: introduce object store fieldJonathan Nieder, Aug 30, 2017
  6. 03/39 object-store: move alt_odb_list and alt_odb_tail to object storeJonathan Nieder, Aug 30, 2017
  7. 04/39 object-store: move packed_git and packed_git_mru to object storeJonathan Nieder, Aug 30, 2017
  8. 05/39 pack: move prepare_packed_git_run_once to object storeJonathan Nieder, Aug 30, 2017
  9. 06/39 pack: move approximate object count to object storeJonathan Nieder, Aug 30, 2017
  10. 07/39 sha1_file: add repository argument to alt_odb_usableJonathan Nieder, Aug 30, 2017
  11. Brandon WilliamsAug 30, 2017
  12. 08/39 sha1_file: add repository argument to link_alt_odb_entryJonathan Nieder, Aug 30, 2017
  13. 09/39 sha1_file: add repository argument to read_info_alternatesJonathan Nieder, Aug 30, 2017
  14. 10/39 sha1_file: add repository argument to link_alt_odb_entriesJonathan Nieder, Aug 30, 2017
  15. 11/39 sha1_file: add repository argument to stat_sha1_fileJonathan Nieder, Aug 30, 2017
  16. 12/39 sha1_file: add repository argument to open_sha1_fileJonathan Nieder, Aug 30, 2017
  17. 13/39 sha1_file: add repository argument to map_sha1_file_1Jonathan Nieder, Aug 30, 2017
  18. 14/39 sha1_file: add repository argument to sha1_loose_object_infoJonathan Nieder, Aug 30, 2017
  19. 15/39 object-store: add repository argument to prepare_alt_odbJonathan Nieder, Aug 30, 2017
  20. 16/39 object-store: add repository argument to foreach_alt_odbJonathan Nieder, Aug 30, 2017
  21. 17/39 pack: add repository argument to install_packed_gitJonathan Nieder, Aug 30, 2017
  22. 18/39 pack: add repository argument to prepare_packed_git_oneJonathan Nieder, Aug 30, 2017
  23. 19/39 pack: add repository argument to rearrange_packed_gitJonathan Nieder, Aug 30, 2017
  24. 20/39 pack: add repository argument to prepare_packed_git_mruJonathan Nieder, Aug 30, 2017
  25. 21/39 pack: add repository argument to prepare_packed_gitJonathan Nieder, Aug 30, 2017
  26. 22/39 pack: add repository argument to reprepare_packed_gitJonathan Nieder, Aug 30, 2017
  27. 23/39 pack: add repository argument to sha1_file_nameJonathan Nieder, Aug 30, 2017
  28. 24/39 pack: add repository argument to map_sha1_fileJonathan Nieder, Aug 30, 2017
  29. 25/39 sha1_file: allow alt_odb_usable to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  30. Junio C HamanoSep 6, 2017
  31. Stefan BellerSep 6, 2017
  32. 26/39 object-store: allow prepare_alt_odb to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  33. 27/39 object-store: allow foreach_alt_odb to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  34. 28/39 pack: allow install_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  35. 29/39 pack: allow rearrange_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  36. 30/39 pack: allow prepare_packed_git_mru to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  37. 31/39 pack: allow prepare_packed_git_one to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  38. 32/39 pack: allow prepare_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  39. 33/39 pack: allow reprepare_packed_git to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  40. 34/39 pack: allow sha1_file_name to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  41. 35/39 pack: allow stat_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  42. 36/39 pack: allow open_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  43. 37/39 pack: allow map_sha1_file_1 to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  44. 38/39 pack: allow map_sha1_file to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  45. 39/39 pack: allow sha1_loose_object_info to handle arbitrary repositoriesJonathan Nieder, Aug 30, 2017
  46. Brandon WilliamsAug 30, 2017

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.