summaryrefslogtreecommitdiff
path: root/t/t0410-partial-clone.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0410-partial-clone.sh')
-rwxr-xr-xt/t0410-partial-clone.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 584a039..a211a66 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -604,6 +604,29 @@ test_expect_success 'do not fetch when checking existence of tree we construct o
git -C repo cherry-pick side1
'
+test_expect_success 'lazy-fetch when accessing object not in the_repository' '
+ rm -rf full partial.git &&
+ test_create_repo full &&
+ test_commit -C full create-a-file file.txt &&
+
+ test_config -C full uploadpack.allowfilter 1 &&
+ test_config -C full uploadpack.allowanysha1inwant 1 &&
+ git clone --filter=blob:none --bare "file://$(pwd)/full" partial.git &&
+ FILE_HASH=$(git -C full rev-parse HEAD:file.txt) &&
+
+ # Sanity check that the file is missing
+ git -C partial.git rev-list --objects --missing=print HEAD >out &&
+ grep "[?]$FILE_HASH" out &&
+
+ git -C full cat-file -s "$FILE_HASH" >expect &&
+ test-tool partial-clone object-info partial.git "$FILE_HASH" >actual &&
+ test_cmp expect actual &&
+
+ # Sanity check that the file is now present
+ git -C partial.git rev-list --objects --missing=print HEAD >out &&
+ ! grep "[?]$FILE_HASH" out
+'
+
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd