diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-23 21:09:30 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-23 21:09:31 (GMT) |
commit | 8faa32231575ce259a9aecd9f4837e9ea13266b5 (patch) | |
tree | bb80301604353b6eefaee9861d7156917ecd9e43 /t | |
parent | bfce3e7b9290a8fe8c4ffc97d6b1e60e041db4f1 (diff) | |
parent | ab3892e48f138e9c519383bb9f48fc48f5ebba65 (diff) | |
download | git-8faa32231575ce259a9aecd9f4837e9ea13266b5.zip git-8faa32231575ce259a9aecd9f4837e9ea13266b5.tar.gz git-8faa32231575ce259a9aecd9f4837e9ea13266b5.tar.bz2 |
Merge branch 'ac/test-lazy-fetch'
A new test to ensure a lazy fetching is not triggered when it
should not be.
* ac/test-lazy-fetch:
partial-clone: add a partial-clone test case
Diffstat (limited to 't')
-rwxr-xr-x | t/t0410-partial-clone.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index f17abd2..1e864cf 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -618,6 +618,25 @@ test_expect_success 'do not fetch when checking existence of tree we construct o git -C repo cherry-pick side1 ' +test_expect_success 'exact rename does not need to fetch the blob lazily' ' + 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 && + FILE_HASH=$(git -C repo rev-parse HEAD:new-file.txt) && + test_config -C repo uploadpack.allowfilter 1 && + test_config -C repo uploadpack.allowanysha1inwant 1 && + + git clone --filter=blob:none --bare "file://$(pwd)/repo" partial.git && + git -C partial.git rev-list --objects --missing=print HEAD >out && + grep "[?]$FILE_HASH" out && + git -C partial.git log --follow -- new-file.txt && + git -C partial.git rev-list --objects --missing=print HEAD >out && + grep "[?]$FILE_HASH" out +' + test_expect_success 'lazy-fetch when accessing object not in the_repository' ' rm -rf full partial.git && test_create_repo full && |