]> git.ipfire.org Git - thirdparty/git.git/blobdiff - apply.c
Revert "t5562: replace /dev/zero with a pipe from generate_zero_bytes"
[thirdparty/git.git] / apply.c
diff --git a/apply.c b/apply.c
index ccab7e7907c874ea1bd6c65fb933abaffc5d0001..892ede5a318f751c80fcceab036a8cbaee391774 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -3182,7 +3182,7 @@ static int apply_binary(struct apply_state *state,
                return 0; /* deletion patch */
        }
 
-       if (has_sha1_file(oid.hash)) {
+       if (has_object_file(&oid)) {
                /* We already have the postimage */
                enum object_type type;
                unsigned long size;
@@ -4019,7 +4019,7 @@ static int read_apply_cache(struct apply_state *state)
                return read_index_from(state->repo->index, state->index_file,
                                       get_git_dir());
        else
-               return read_index(state->repo->index);
+               return repo_read_index(state->repo);
 }
 
 /* This function tries to read the object name from the current index */
@@ -4712,7 +4712,8 @@ static int apply_patch(struct apply_state *state,
                                                  state->index_file,
                                                  LOCK_DIE_ON_ERROR);
                else
-                       hold_locked_index(&state->lock_file, LOCK_DIE_ON_ERROR);
+                       repo_hold_locked_index(state->repo, &state->lock_file,
+                                              LOCK_DIE_ON_ERROR);
        }
 
        if (state->check_index && read_apply_cache(state) < 0) {