From: Brandon Williams Date: Wed, 21 Mar 2018 22:34:40 GMT Subject: Re: [PATCH 32/44] sha1_file: allow sha1_loose_object_info to handle arbitrary repositories Message-ID: <20180321223440.GA202156@google.com> In-Reply-To: <20180303113637.26518-33-pclouds@gmail.com> On 03/03, Nguyễn Thái Ngọc Duy wrote: > From: Jonathan Nieder > > Signed-off-by: Stefan Beller > Signed-off-by: Jonathan Nieder > Signed-off-by: Junio C Hamano > Signed-off-by: Nguyễn Thái Ngọc Duy Patches up to here look sane. > --- > sha1_file.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/sha1_file.c b/sha1_file.c > index c5a8b00aed..7066d4c9ce 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; > > -- > 2.16.1.435.g8f24da2e1a > -- Brandon Williams