* Map the loose object at "path" if it is not NULL, or the path found by
* searching for a loose object named "sha1".
*/
-static void *map_sha1_file_1(const char *path,
- const unsigned char *sha1,
- unsigned long *size)
+#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)
{
void *map;
int fd;
void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
{
- return map_sha1_file_1(NULL, sha1, size);
+ return map_sha1_file_1(the_repository, NULL, sha1, size);
}
static int unpack_sha1_short_header(git_zstream *stream,
*contents = NULL;
- map = map_sha1_file_1(path, NULL, &mapsize);
+ map = map_sha1_file_1(the_repository, path, NULL, &mapsize);
if (!map) {
error_errno("unable to mmap %s", path);
goto out;