path: root/http-walker.c
diff options
authorJeff King <>2018-08-28 21:22:44 (GMT)
committerJunio C Hamano <>2018-08-29 18:32:49 (GMT)
commite3ff0683e22070ce42c3c373f6e89e9dc38b756c (patch)
treecf66b2e24d19b147c0bf10bab25ae4222978a2ab /http-walker.c
parent4a7e27e95797c0a094f8ee300a260777ddd7eec9 (diff)
convert "hashcmp() == 0" to hasheq()
This is the partner patch to the previous one, but covering the "hash" variants instead of "oid". Note that our coccinelle rule is slightly more complex to avoid triggering the call in hasheq(). I didn't bother to add a new rule to convert: - hasheq(E1->hash, E2->hash) + oideq(E1, E2) Since these are new functions, there won't be any such existing callers. And since most of the code is already using oideq, we're not likely to introduce new ones. We might still see "!hashcmp(E1->hash, E2->hash)" from topics in flight. But because our new rule comes after the existing ones, that should first get converted to "!oidcmp(E1, E2)" and then to "oideq(E1, E2)". Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'http-walker.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/http-walker.c b/http-walker.c
index 7cdfb2f..3a8edc7 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -483,7 +483,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
list_for_each(pos, head) {
obj_req = list_entry(pos, struct object_request, node);
- if (!hashcmp(obj_req->oid.hash, sha1))
+ if (hasheq(obj_req->oid.hash, sha1))
if (obj_req == NULL)