]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sha1_file: allow map_sha1_file to handle arbitrary repositories
authorStefan Beller <sbeller@google.com>
Fri, 23 Mar 2018 17:21:20 +0000 (18:21 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Mar 2018 17:05:55 +0000 (10:05 -0700)
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>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-store.h
sha1_file.c

index d9cc875153c6917ee90cd6654c91e1ce4bfe4c32..fef33f345f0a2334f99e09f544d8ea9a8b034e81 100644 (file)
@@ -127,7 +127,6 @@ void raw_object_store_clear(struct raw_object_store *o);
  */
 void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned char *sha1);
 
-#define map_sha1_file(r, s, sz) map_sha1_file_##r(s, sz)
-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);
 
 #endif /* OBJECT_STORE_H */
index 1d5d23dfe2e99b2eb34f5f57786582096472123d..9addad68877bd27f435fc2dba4399bc544e19db6 100644 (file)
@@ -957,9 +957,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,