The twelfth batch
[git/gitster.git] / t / t5608-clone-2gb.sh
blob87a8cd9f98381a868384f7af5d228d57e5613e2b
1 #!/bin/sh
3 test_description='Test cloning a repository larger than 2 gigabyte'
4 . ./test-lib.sh
6 if ! test_bool_env GIT_TEST_CLONE_2GB false
7 then
8 skip_all='expensive 2GB clone test; enable with GIT_TEST_CLONE_2GB=true'
9 test_done
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)) &&
18 i=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 &&
26 i=$(($i+1)) ||
27 echo $? > exit-status
28 done &&
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" &&
32 echo "data 5" &&
33 echo ">2gb" &&
34 cat commit) |
35 git fast-import --big-file-threshold=2 &&
36 test ! -f exit-status
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
52 test_done