3 test_description
='git read-tree in partial clones'
9 test_expect_success
'read-tree in partial clone prefetches in one batch' '
10 test_when_finished "rm -rf server client trace" &&
13 echo foo >server/one &&
14 echo bar >server/two &&
15 git -C server add one two &&
16 git -C server commit -m "initial commit" &&
17 TREE=$(git -C server rev-parse HEAD^{tree}) &&
19 git -C server config uploadpack.allowfilter 1 &&
20 git -C server config uploadpack.allowanysha1inwant 1 &&
21 git clone --bare --filter=blob:none "file://$(pwd)/server" client &&
22 GIT_TRACE_PACKET="$(pwd)/trace" git -C client read-tree $TREE &&
24 # "done" marks the end of negotiation (once per fetch). Expect that
25 # only one fetch occurs.
26 grep "fetch> done" trace >donelines &&
27 test_line_count = 1 donelines