]> git.ipfire.org Git - thirdparty/git.git/blobdiff - apply.c
entry: check for fstat() errors after checkout
[thirdparty/git.git] / apply.c
diff --git a/apply.c b/apply.c
index fab44322c5f27952842b6bcfe48bd5e5f8a3c739..bdc008fae2ad77197a859d64196bf91161cf8d67 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -3157,7 +3157,8 @@ static int apply_binary(struct apply_state *state,
                 * See if the old one matches what the patch
                 * applies to.
                 */
-               hash_object_file(img->buf, img->len, blob_type, &oid);
+               hash_object_file(the_hash_algo, img->buf, img->len, blob_type,
+                                &oid);
                if (strcmp(oid_to_hex(&oid), patch->old_oid_prefix))
                        return error(_("the patch applies to '%s' (%s), "
                                       "which does not match the "
@@ -3202,7 +3203,8 @@ static int apply_binary(struct apply_state *state,
                                     name);
 
                /* verify that the result matches */
-               hash_object_file(img->buf, img->len, blob_type, &oid);
+               hash_object_file(the_hash_algo, img->buf, img->len, blob_type,
+                                &oid);
                if (strcmp(oid_to_hex(&oid), patch->new_oid_prefix))
                        return error(_("binary patch to '%s' creates incorrect result (expecting %s, got %s)"),
                                name, patch->new_oid_prefix, oid_to_hex(&oid));