diff options
author | Jeff King <peff@peff.net> | 2018-08-29 00:22:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-29 21:32:49 +0300 |
commit | 67947c34ae8f666e72b9406a38984fe8386f5e50 (patch) | |
tree | c9ae21d6995cf9011777cb9d336bfa14f4587fc5 /pack-check.c | |
parent | 9001dc2a7493f1366a183c3a9175f608769321d5 (diff) |
convert "hashcmp() != 0" to "!hasheq()"
This rounds out the previous three patches, covering the
inequality logic for the "hash" variant of the functions.
As with the previous three, the accompanying code changes
are the mechanical result of applying the coccinelle patch;
see those patches for more discussion.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-check.c')
-rw-r--r-- | pack-check.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pack-check.c b/pack-check.c index d3a57df34f2..fa5f0ff8fa5 100644 --- a/pack-check.c +++ b/pack-check.c @@ -79,10 +79,10 @@ static int verify_packfile(struct packed_git *p, } while (offset < pack_sig_ofs); the_hash_algo->final_fn(hash, &ctx); pack_sig = use_pack(p, w_curs, pack_sig_ofs, NULL); - if (hashcmp(hash, pack_sig)) + if (!hasheq(hash, pack_sig)) err = error("%s pack checksum mismatch", p->pack_name); - if (hashcmp(index_base + index_size - the_hash_algo->hexsz, pack_sig)) + if (!hasheq(index_base + index_size - the_hash_algo->hexsz, pack_sig)) err = error("%s pack checksum does not match its index", p->pack_name); unuse_pack(w_curs); @@ -180,7 +180,7 @@ int verify_pack_index(struct packed_git *p) the_hash_algo->init_fn(&ctx); the_hash_algo->update_fn(&ctx, index_base, (unsigned int)(index_size - the_hash_algo->rawsz)); the_hash_algo->final_fn(hash, &ctx); - if (hashcmp(hash, index_base + index_size - the_hash_algo->rawsz)) + if (!hasheq(hash, index_base + index_size - the_hash_algo->rawsz)) err = error("Packfile index for %s hash mismatch", p->pack_name); return err; |