sha1-file: make pretend_object_file() not prefetch
commita64d2aae5a593f4fb8b2020dc39556b256d1846e
authorJonathan Tan <jonathantanmy@google.com>
Tue, 21 Jul 2020 22:50:20 +0000 (21 15:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jul 2020 23:27:22 +0000 (21 16:27 -0700)
tree2f97e6b0d233db7b60615b61f5dce4f3ce8d4b38
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec
sha1-file: make pretend_object_file() not prefetch

When pretend_object_file() is invoked with an object that does not exist
(as is the typical case), there is no need to fetch anything from the
promisor remote, because the caller already knows what the object is
supposed to contain. Therefore, suppress the fetch. (The
OBJECT_INFO_QUICK flag is added for the same reason.)

This was noticed at $DAYJOB when "blame" was run on a file that had
uncommitted modifications.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1-file.c
t/t8002-blame.sh