Git fork
at reftables-rust 52 lines 1.2 kB view raw
1#!/bin/sh 2 3test_description='Test cloning a repository larger than 2 gigabyte' 4. ./test-lib.sh 5 6if ! test_bool_env GIT_TEST_CLONE_2GB false 7then 8 skip_all='expensive 2GB clone test; enable with GIT_TEST_CLONE_2GB=true' 9 test_done 10fi 11 12test_expect_success 'setup' ' 13 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 20 do 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 37 38' 39 40test_expect_success 'clone - bare' ' 41 42 git clone --bare --no-hardlinks . clone-bare 43 44' 45 46test_expect_success 'clone - with worktree, file:// protocol' ' 47 48 git clone "file://$(pwd)" clone-wt 49 50' 51 52test_done