From abef9020e3df87c441c9a3a95f592fce5fa49bb9 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 12 Mar 2018 02:27:46 +0000 Subject: sha1_file: convert sha1_object_info* to object_id Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2; @@ - sha1_object_info(E1.hash, E2) + oid_object_info(&E1, E2) @@ expression E1, E2; @@ - sha1_object_info(E1->hash, E2) + oid_object_info(E1, E2) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1.hash, E2, E3) + oid_object_info_extended(&E1, E2, E3) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1->hash, E2, E3) + oid_object_info_extended(E1, E2, E3) Signed-off-by: Junio C Hamano --- packfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packfile.c') diff --git a/packfile.c b/packfile.c index 3e31ad7a0c..f26395ecab 100644 --- a/packfile.c +++ b/packfile.c @@ -1101,7 +1101,7 @@ static int retry_bad_packed_offset(struct packed_git *p, off_t obj_offset) return OBJ_BAD; nth_packed_object_oid(&oid, p, revidx->nr); mark_bad_packed_object(p, oid.hash); - type = sha1_object_info(oid.hash, NULL); + type = oid_object_info(&oid, NULL); if (type <= OBJ_NONE) return OBJ_BAD; return type; @@ -1461,7 +1461,7 @@ static void *read_object(const struct object_id *oid, enum object_type *type, oi.sizep = size; oi.contentp = &content; - if (sha1_object_info_extended(oid->hash, &oi, 0) < 0) + if (oid_object_info_extended(oid, &oi, 0) < 0) return NULL; return content; } -- cgit v1.3-5-g9baa