mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
9001dc2a74
commit
67947c34ae
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user