diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2017-08-30 00:18:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-07 08:49:46 +0900 |
commit | 141d39d7c272ee1642faa3a29f0312db0606a1b7 (patch) | |
tree | 8bd87f12ce3e2d4fd35b312cf4d49e7c8360d5ec | |
parent | 3e1a72640bcfad06cf9233f68d1d2e162278c00a (diff) | |
download | git-jn/per-repo-obj-store.tar.gz |
pack: allow sha1_loose_object_info to handle arbitrary repositoriesjn/per-repo-obj-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>
-rw-r--r-- | sha1_file.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sha1_file.c b/sha1_file.c index dc3c0b07ea..0f302a8c48 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -1096,10 +1096,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; @@ -1123,14 +1122,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; |