summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2017-08-30 00:16:56 -0700
committerJunio C Hamano <gitster@pobox.com>2017-09-07 08:49:46 +0900
commit3e1a72640bcfad06cf9233f68d1d2e162278c00a (patch)
tree4ea3b353e817bd6f87d4f01f27e0a1f0e36b2cd7
parentfbf3740332894ca7d49254e71c9d458c3cd67564 (diff)
downloadgit-3e1a72640bcfad06cf9233f68d1d2e162278c00a.tar.gz
pack: allow map_sha1_file to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--object-store.h3
-rw-r--r--sha1_file.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/object-store.h b/object-store.h
index fe2187fd65..57b8d89738 100644
--- a/object-store.h
+++ b/object-store.h
@@ -61,8 +61,7 @@ struct packed_git {
* is overwritten each time the function is called.
*/
extern const char *sha1_file_name(struct repository *r, const unsigned char *sha1);
-#define map_sha1_file(r, s, sz) map_sha1_file_##r(s, sz)
-extern void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size);
+extern void *map_sha1_file(struct repository *r, const unsigned char *sha1, unsigned long *size);
extern void prepare_alt_odb(struct repository *r);
diff --git a/sha1_file.c b/sha1_file.c
index 7fc5ebf2af..dc3c0b07ea 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -904,9 +904,10 @@ static void *map_sha1_file_1(struct repository *r, const char *path,
return map;
}
-void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size)
+void *map_sha1_file(struct repository *r,
+ const unsigned char *sha1, unsigned long *size)
{
- return map_sha1_file_1(the_repository, NULL, sha1, size);
+ return map_sha1_file_1(r, NULL, sha1, size);
}
static int unpack_sha1_short_header(git_zstream *stream,