summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apply.c b/apply.c
index fab44322c5..144c19aaca 100644
--- 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));
@@ -4347,7 +4349,7 @@ static int try_create_file(struct apply_state *state, const char *path,
if (fd < 0)
return 1;
- if (convert_to_working_tree(state->repo->index, path, buf, size, &nbuf)) {
+ if (convert_to_working_tree(state->repo->index, path, buf, size, &nbuf, NULL)) {
size = nbuf.len;
buf = nbuf.buf;
}