Thread (46 messages) flat view 46 messages, 5 authors, 2017-09-06
STALE3263d

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

From: Jonathan Nieder <hidden>
Date: 2017-08-30 07:16:39
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help