mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
sha1-file: allow check_object_signature() to handle any repo
Some callers of check_object_signature() can work on arbitrary repositories, but the repo does not get passed to this function. Instead, the_repository is always used internally. To fix possible inconsistencies, allow the function to receive a struct repository and make those callers pass on the repo being handled. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2dcde20e1c
commit
b98d188581
@@ -144,7 +144,7 @@ static int verify_packfile(struct repository *r,
|
||||
err = error("cannot unpack %s from %s at offset %"PRIuMAX"",
|
||||
oid_to_hex(entries[i].oid.oid), p->pack_name,
|
||||
(uintmax_t)entries[i].offset);
|
||||
else if (check_object_signature(entries[i].oid.oid, data, size, type_name(type)))
|
||||
else if (check_object_signature(r, entries[i].oid.oid, data, size, type_name(type)))
|
||||
err = error("packed %s from %s is corrupt",
|
||||
oid_to_hex(entries[i].oid.oid), p->pack_name);
|
||||
else if (fn) {
|
||||
|
||||
Reference in New Issue
Block a user