3 test_description='Test cloning a repository larger than 2 gigabyte'
6 if ! test_bool_env GIT_TEST_CLONE_2GB false
8 skip_all='expensive 2GB clone test; enable with GIT_TEST_CLONE_2GB=true'
12 test_expect_success 'setup' '
14 git config pack.compression 0 &&
15 git config pack.depth 0 &&
16 blobsize=$((100*1024*1024)) &&
17 blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
19 (while test $i -le $blobcount
21 printf "Generating blob $i/$blobcount\r" >&2 &&
22 printf "blob\nmark :$i\ndata $blobsize\n" &&
23 #test-tool genrandom $i $blobsize &&
24 printf "%-${blobsize}s" $i &&
25 echo "M 100644 :$i $i" >> commit &&
29 echo "commit refs/heads/main" &&
30 echo "author A U Thor <author@email.com> 123456789 +0000" &&
31 echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
35 git fast-import --big-file-threshold=2 &&
40 test_expect_success 'clone - bare' '
42 git clone --bare --no-hardlinks . clone-bare
46 test_expect_success 'clone - with worktree, file:// protocol' '
48 git clone "file://$(pwd)" clone-wt