From: Abhradeep Chakraborty via GitGitGadget Date: Sun, 13 Mar 2022 17:39:22 GMT Subject: [PATCH] partial-clone: add a partial-clone test case Message-ID: From: Abhradeep Chakraborty In a blobless-cloned repo, `git log --follow -- ` (`` have an exact OID rename) doesn't download blob of the file from where the new file is renamed. Add a test case to verify it. Signed-off-by: Abhradeep Chakraborty --- partial-clone: add a partial-clone test case Fixes #827 [1] [1] https://github.com/gitgitgadget/git/issues/827 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1175%2FAbhra303%2Fcheck_partial_clone-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1175/Abhra303/check_partial_clone-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/1175 t/t0410-partial-clone.sh | 16 ++++++++++++++++ t/test-lib-functions.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index f17abd298c8..1e54f4844fd 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -618,6 +618,22 @@ test_expect_success 'do not fetch when checking existence of tree we construct o git -C repo cherry-pick side1 ' +test_expect_success 'git log --follow does not download blobs if an exact OID rename found (blobless clone)' ' + rm -rf repo partial.git && + test_create_repo repo && + content="some dummy content" && + test_commit -C repo create-a-file file.txt "$content" && + git -C repo mv file.txt new-file.txt && + git -C repo commit -m rename-the-file && + test_config -C repo uploadpack.allowfilter 1 && + test_config -C repo uploadpack.allowanysha1inwant 1 && + + git clone --filter=blob:none "file://$(pwd)/repo" partial.git && + GIT_TRACE2_EVENT="$(pwd)/trace.txt" \ + git -C partial.git log --follow -- new-file.txt > "$(pwd)/trace.txt" && + ! test_subcommand_inexact fetch