diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-03-12 03:27:39 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-14 17:23:49 +0100 |
commit | 17e65451e305b7501fddec35125bf5d39a4cdcac (patch) | |
tree | ffd070759d814151fd56faebfa4a9b951eeaa240 /object.c | |
parent | sha1_file: convert read_loose_object to use struct object_id (diff) | |
download | git-17e65451e305b7501fddec35125bf5d39a4cdcac.tar.xz git-17e65451e305b7501fddec35125bf5d39a4cdcac.zip |
sha1_file: convert check_sha1_signature to struct object_id
Convert this function to take a pointer to struct object_id and rename
it check_object_signature. Introduce temporaries to convert the return
values of lookup_replace_object and lookup_replace_object_extended into
struct object_id.
The temporaries are needed because in order to convert
lookup_replace_object, open_istream needs to be converted, and
open_istream needs check_sha1_signature to be converted, causing a loop
of dependencies. The temporaries will be removed in a future patch.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -255,7 +255,10 @@ struct object *parse_object(const struct object_id *oid) if ((obj && obj->type == OBJ_BLOB && has_object_file(oid)) || (!obj && has_object_file(oid) && sha1_object_info(oid->hash, NULL) == OBJ_BLOB)) { - if (check_sha1_signature(repl, NULL, 0, NULL) < 0) { + struct object_id reploid; + hashcpy(reploid.hash, repl); + + if (check_object_signature(&reploid, NULL, 0, NULL) < 0) { error("sha1 mismatch %s", oid_to_hex(oid)); return NULL; } @@ -265,7 +268,10 @@ struct object *parse_object(const struct object_id *oid) buffer = read_sha1_file(oid->hash, &type, &size); if (buffer) { - if (check_sha1_signature(repl, buffer, size, type_name(type)) < 0) { + struct object_id reploid; + hashcpy(reploid.hash, repl); + + if (check_object_signature(&reploid, buffer, size, type_name(type)) < 0) { free(buffer); error("sha1 mismatch %s", sha1_to_hex(repl)); return NULL; |