summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-04-25 18:21:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 01:54:27 (GMT)
commit589de911852cc3ce689fa3702ecb54c0049aeec1 (patch)
treefdc80041530355b235eb6f9e8ebd1049ab31fcd7 /packfile.c
parent57a6a500be8d8ee903a1dc9ea607063a1bc88a0b (diff)
downloadgit-589de911852cc3ce689fa3702ecb54c0049aeec1.zip
git-589de911852cc3ce689fa3702ecb54c0049aeec1.tar.gz
git-589de911852cc3ce689fa3702ecb54c0049aeec1.tar.bz2
packfile: add repository argument to cache_or_unpack_entry
Add a repository argument to allow the callers of cache_or_unpack_entry to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c
index d5ac48e..8de87f9 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1272,7 +1272,8 @@ static void detach_delta_base_cache_entry(struct delta_base_cache_entry *ent)
free(ent);
}
-static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
+#define cache_or_unpack_entry(r, p, bo, bs, t) cache_or_unpack_entry_##r(p, bo, bs, t)
+static void *cache_or_unpack_entry_the_repository(struct packed_git *p, off_t base_offset,
unsigned long *base_size, enum object_type *type)
{
struct delta_base_cache_entry *ent;
@@ -1346,7 +1347,7 @@ int packed_object_info_the_repository(struct packed_git *p, off_t obj_offset,
* a "real" type later if the caller is interested.
*/
if (oi->contentp) {
- *oi->contentp = cache_or_unpack_entry(p, obj_offset, oi->sizep,
+ *oi->contentp = cache_or_unpack_entry(the_repository, p, obj_offset, oi->sizep,
&type);
if (!*oi->contentp)
type = OBJ_BAD;