Merge branch 'cb/maint-orphan-merge-noclobber'
[git/kirr.git] / t / t5705-clone-2gb.sh
blobe9783c341a97afdd58aa2adddc8c6db4adb54bee
1 #!/bin/sh
3 test_description='Test cloning a repository larger than 2 gigabyte'
4 . ./test-lib.sh
6 if test -z "$GIT_TEST_CLONE_2GB"
7 then
8 say 'Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t'
9 else
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)) &&
19 i=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
27 i=$(($i+1)) ||
28 echo $? > exit-status
29 done &&
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" &&
33 echo "data 5" &&
34 echo ">2gb" &&
35 cat commit) |
36 git fast-import --big-file-threshold=2 &&
37 test ! -f exit-status
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://. clone-wt
53 test_done