summaryrefslogtreecommitdiffstats
path: root/t/t1022-read-tree-partial-clone.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:47:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:47:53 +0000
commitc8bae7493d2f2910b57f13ded012e86bdcfb0532 (patch)
tree24e09d9f84dec336720cf393e156089ca2835791 /t/t1022-read-tree-partial-clone.sh
parentInitial commit. (diff)
downloadgit-c8bae7493d2f2910b57f13ded012e86bdcfb0532.tar.xz
git-c8bae7493d2f2910b57f13ded012e86bdcfb0532.zip
Adding upstream version 1:2.39.2.upstream/1%2.39.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/t1022-read-tree-partial-clone.sh')
-rwxr-xr-xt/t1022-read-tree-partial-clone.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t1022-read-tree-partial-clone.sh b/t/t1022-read-tree-partial-clone.sh
new file mode 100755
index 0000000..da53971
--- /dev/null
+++ b/t/t1022-read-tree-partial-clone.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='git read-tree in partial clones'
+
+TEST_NO_CREATE_REPO=1
+
+. ./test-lib.sh
+
+test_expect_success 'read-tree in partial clone prefetches in one batch' '
+ test_when_finished "rm -rf server client trace" &&
+
+ git init server &&
+ echo foo >server/one &&
+ echo bar >server/two &&
+ git -C server add one two &&
+ git -C server commit -m "initial commit" &&
+ TREE=$(git -C server rev-parse HEAD^{tree}) &&
+
+ git -C server config uploadpack.allowfilter 1 &&
+ git -C server config uploadpack.allowanysha1inwant 1 &&
+ git clone --bare --filter=blob:none "file://$(pwd)/server" client &&
+ GIT_TRACE_PACKET="$(pwd)/trace" git -C client read-tree $TREE $TREE &&
+
+ # "done" marks the end of negotiation (once per fetch). Expect that
+ # only one fetch occurs.
+ grep "fetch> done" trace >donelines &&
+ test_line_count = 1 donelines
+'
+
+test_done