3 test_description
='git p4 fetching changes in multiple blocks'
7 test_expect_success
'start p4d' '
11 test_expect_success
'Create a repo with ~100 changes' '
16 p4 submit -d "Add file.txt" &&
17 for i in $(test_seq 0 9)
21 p4 submit -d "Adding outer$i.txt" &&
22 for j in $(test_seq 0 9)
25 echo $i$j >file.txt &&
26 p4 submit -d "Commit $i$j" || exit
32 test_expect_success
'Clone the repo' '
33 git p4 clone --dest="$git" --changes-block-size=10 --verbose //depot@all
36 test_expect_success
'All files are present' '
37 echo file.txt >expected &&
38 test_write_lines outer0.txt outer1.txt outer2.txt outer3.txt outer4.txt >>expected &&
39 test_write_lines outer5.txt outer6.txt outer7.txt outer8.txt outer9.txt >>expected &&
41 test_cmp expected current
44 test_expect_success
'file.txt is correct' '
46 test_cmp expected "$git/file.txt"
49 test_expect_success
'Correct number of commits' '
50 (cd "$git" && git log --oneline) >log &&
51 test_line_count = 111 log
54 test_expect_success
'Previous version of file.txt is correct' '
55 (cd "$git" && git checkout HEAD^^) &&
57 test_cmp expected "$git/file.txt"
60 test_expect_success
'kill p4d' '