]> git.ipfire.org Git - thirdparty/git.git/blobdiff - object-file.c
Use the final_oid_fn to finalize hashing of object IDs
[thirdparty/git.git] / object-file.c
index ef1eb984c850be2249cdfcf54947d29ee63fe451..1d8c82fa99db72de8d5018eeecf4b0190cb5a4aa 100644 (file)
@@ -1054,7 +1054,7 @@ int check_object_signature(struct repository *r, const struct object_id *oid,
                        break;
                r->hash_algo->update_fn(&c, buf, readlen);
        }
-       r->hash_algo->final_fn(real_oid.hash, &c);
+       r->hash_algo->final_oid_fn(&real_oid, &c);
        close_istream(st);
        return !oideq(oid, &real_oid) ? -1 : 0;
 }
@@ -1755,7 +1755,7 @@ static void write_object_file_prepare(const struct git_hash_algo *algo,
        algo->init_fn(&c);
        algo->update_fn(&c, hdr, *hdrlen);
        algo->update_fn(&c, buf, len);
-       algo->final_fn(oid->hash, &c);
+       algo->final_oid_fn(oid, &c);
 }
 
 /*
@@ -1927,7 +1927,7 @@ static int write_loose_object(const struct object_id *oid, char *hdr,
        if (ret != Z_OK)
                die(_("deflateEnd on object %s failed (%d)"), oid_to_hex(oid),
                    ret);
-       the_hash_algo->final_fn(parano_oid.hash, &c);
+       the_hash_algo->final_oid_fn(&parano_oid, &c);
        if (!oideq(oid, &parano_oid))
                die(_("confused by unstable object source data for %s"),
                    oid_to_hex(oid));
@@ -2508,7 +2508,7 @@ static int check_stream_oid(git_zstream *stream,
                return -1;
        }
 
-       the_hash_algo->final_fn(real_oid.hash, &c);
+       the_hash_algo->final_oid_fn(&real_oid, &c);
        if (!oideq(expected_oid, &real_oid)) {
                error(_("hash mismatch for %s (expected %s)"), path,
                      oid_to_hex(expected_oid));