3 test_description='Test cloning a repository larger than 2 gigabyte'
6 if test -z "$GIT_TEST_CLONE_2GB"
8 say 'Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t'
10 test_set_prereq CLONE_2GB
13 test_expect_success CLONE_2GB 'setup' '
15 git config pack.compression 0 &&
16 git config pack.depth 0 &&
17 blobsize=$((100*1024*1024)) &&
18 blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
20 (while test $i -le $blobcount
22 printf "Generating blob $i/$blobcount\r" >&2 &&
23 printf "blob\nmark :$i\ndata $blobsize\n" &&
24 #test-genrandom $i $blobsize &&
25 printf "%-${blobsize}s" $i &&
26 echo "M 100644 :$i $i" >> commit
30 echo "commit refs/heads/master" &&
31 echo "author A U Thor <author@email.com> 123456789 +0000" &&
32 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
36 git fast-import --big-file-threshold=2 &&
41 test_expect_success CLONE_2GB 'clone - bare' '
43 git clone --bare --no-hardlinks . clone-bare
47 test_expect_success CLONE_2GB 'clone - with worktree, file:// protocol' '
49 git clone "file://$(pwd)" clone-wt