Skip to content

Commit bd27f50

Browse files
stefanbellergitster
authored andcommitted
sha1_file: allow map_sha1_file to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1fea63e commit bd27f50

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

object-store.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ void raw_object_store_clear(struct raw_object_store *o);
127127
*/
128128
void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned char *sha1);
129129

130-
#define map_sha1_file(r, s, sz) map_sha1_file_##r(s, sz)
131-
void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size);
130+
void *map_sha1_file(struct repository *r, const unsigned char *sha1, unsigned long *size);
132131

133132
#endif /* OBJECT_STORE_H */

sha1_file.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,9 +957,10 @@ static void *map_sha1_file_1(struct repository *r, const char *path,
957957
return map;
958958
}
959959

960-
void *map_sha1_file_the_repository(const unsigned char *sha1, unsigned long *size)
960+
void *map_sha1_file(struct repository *r,
961+
const unsigned char *sha1, unsigned long *size)
961962
{
962-
return map_sha1_file_1(the_repository, NULL, sha1, size);
963+
return map_sha1_file_1(r, NULL, sha1, size);
963964
}
964965

965966
static int unpack_sha1_short_header(git_zstream *stream,

0 commit comments

Comments
 (0)