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

t1022-read-tree-partial-clone.sh « t - git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cca4380e4319a024416c4bbe2e097f63e409af48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

test_description='git read-tree in partial clones'

TEST_NO_CREATE_REPO=1
TEST_PASSES_SANITIZE_LEAK=true
. ./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