summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2020-08-05 16:06:50 -0700
committerJunio C Hamano <gitster@pobox.com>2020-08-06 13:01:02 -0700
commit3318238db9498749db6d4feb7a804d366eccfa82 (patch)
tree0e7cd4c057fa2365698296f7ef8f1fe02222b75c /apply.c
parent1d8d9cb62099e1524ce1269ea88faad871c2197f (diff)
downloadgit-3318238db9498749db6d4feb7a804d366eccfa82.tar.gz
apply: do not lazy fetch when applying binary
When applying a binary patch, as an optimization, "apply" checks if the postimage is already present. During this fetch, it is perfectly expected for the postimage not to be present, so there is no need to lazy-fetch missing objects. Teach "apply" not to lazy-fetch in this case. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 8bff604dbe..402d80602a 100644
--- a/apply.c
+++ b/apply.c
@@ -3178,7 +3178,7 @@ static int apply_binary(struct apply_state *state,
return 0; /* deletion patch */
}
- if (has_object_file(&oid)) {
+ if (has_object(the_repository, &oid, 0)) {
/* We already have the postimage */
enum object_type type;
unsigned long size;