summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-04-25 18:21:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 01:54:27 (GMT)
commit0df23781fedc5be6c0dc943e39107b7f1b265826 (patch)
tree8529671c6ed92b6289be6d9ee65fb32b73e6ada0 /packfile.c
parent0df8e96566ddcae4adc4efc096944c064f60b8bd (diff)
downloadgit-0df23781fedc5be6c0dc943e39107b7f1b265826.zip
git-0df23781fedc5be6c0dc943e39107b7f1b265826.tar.gz
git-0df23781fedc5be6c0dc943e39107b7f1b265826.tar.bz2
packfile: add repository argument to retry_bad_packed_offset
Add a repository argument to allow the callers of retry_bad_packed_offset to be more specific about which repository to handle. 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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/packfile.c b/packfile.c
index 80c7fa7..d2b3f35 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1104,7 +1104,9 @@ static const unsigned char *get_delta_base_sha1(struct packed_git *p,
return NULL;
}
-static int retry_bad_packed_offset(struct packed_git *p, off_t obj_offset)
+#define retry_bad_packed_offset(r, p, o) \
+ retry_bad_packed_offset_##r(p, o)
+static int retry_bad_packed_offset_the_repository(struct packed_git *p, off_t obj_offset)
{
int type;
struct revindex_entry *revidx;
@@ -1153,7 +1155,7 @@ static enum object_type packed_to_object_type(struct packed_git *p,
if (type <= OBJ_NONE) {
/* If getting the base itself fails, we first
* retry the base, otherwise unwind */
- type = retry_bad_packed_offset(p, base_offset);
+ type = retry_bad_packed_offset(the_repository, p, base_offset);
if (type > OBJ_NONE)
goto out;
goto unwind;
@@ -1181,7 +1183,7 @@ out:
unwind:
while (poi_stack_nr) {
obj_offset = poi_stack[--poi_stack_nr];
- type = retry_bad_packed_offset(p, obj_offset);
+ type = retry_bad_packed_offset(the_repository, p, obj_offset);
if (type > OBJ_NONE)
goto out;
}