summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2018-03-23 18:21:21 +0100
committerJunio C Hamano <gitster@pobox.com>2018-03-26 10:05:55 -0700
commit4a7c05f7d7f17cd7a42fa944e79c2ef294cb17b6 (patch)
treed38a31f35f296d3928c565584eab1b2240b15f83
parentbd27f50c801410433542a31122985b7d808b0a7f (diff)
downloadgit-sb/object-store.tar.gz
sha1_file: allow sha1_loose_object_info to handle arbitrary repositoriessb/object-store
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>
-rw-r--r--sha1_file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 9addad6887..0989bbd948 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1149,10 +1149,9 @@ int parse_sha1_header(const char *hdr, unsigned long *sizep)
return parse_sha1_header_extended(hdr, &oi, 0);
}
-#define sha1_loose_object_info(r, s, o, f) sha1_loose_object_info_##r(s, o, f)
-static int sha1_loose_object_info_the_repository(const unsigned char *sha1,
- struct object_info *oi,
- int flags)
+static int sha1_loose_object_info(struct repository *r,
+ const unsigned char *sha1,
+ struct object_info *oi, int flags)
{
int status = 0;
unsigned long mapsize;
@@ -1176,14 +1175,14 @@ static int sha1_loose_object_info_the_repository(const unsigned char *sha1,
if (!oi->typep && !oi->typename && !oi->sizep && !oi->contentp) {
const char *path;
struct stat st;
- if (stat_sha1_file(the_repository, sha1, &st, &path) < 0)
+ if (stat_sha1_file(r, sha1, &st, &path) < 0)
return -1;
if (oi->disk_sizep)
*oi->disk_sizep = st.st_size;
return 0;
}
- map = map_sha1_file(the_repository, sha1, &mapsize);
+ map = map_sha1_file(r, sha1, &mapsize);
if (!map)
return -1;