Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2020-07-22 01:50:20 +0300
committerJunio C Hamano <gitster@pobox.com>2020-07-22 02:27:22 +0300
commita64d2aae5a593f4fb8b2020dc39556b256d1846e (patch)
tree2f97e6b0d233db7b60615b61f5dce4f3ce8d4b38 /t/t8002-blame.sh
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
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>
Diffstat (limited to 't/t8002-blame.sh')
-rwxr-xr-xt/t8002-blame.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index eea048e52c..2ed6aaae35 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -122,4 +122,15 @@ test_expect_success '--exclude-promisor-objects does not BUG-crash' '
test_must_fail git blame --exclude-promisor-objects one
'
+test_expect_success 'blame with uncommitted edits in partial clone does not crash' '
+ git init server &&
+ echo foo >server/file.txt &&
+ git -C server add file.txt &&
+ git -C server commit -m file &&
+
+ git clone --filter=blob:none "file://$(pwd)/server" client &&
+ echo bar >>client/file.txt &&
+ git -C client blame file.txt
+'
+
test_done