]>
Commit | Line | Data |
---|---|---|
ca31f0b5 JS |
1 | #!/bin/sh |
2 | ||
3 | test_description='Test cloning a repository larger than 2 gigabyte' | |
4 | . ./test-lib.sh | |
5 | ||
a85efb59 | 6 | if ! test_bool_env GIT_TEST_CLONE_2GB false |
2c7e134c | 7 | then |
d63ae319 CMAB |
8 | skip_all='expensive 2GB clone test; enable with GIT_TEST_CLONE_2GB=true' |
9 | test_done | |
2c7e134c | 10 | fi |
ca31f0b5 | 11 | |
d63ae319 | 12 | test_expect_success 'setup' ' |
ca31f0b5 JS |
13 | |
14 | git config pack.compression 0 && | |
15 | git config pack.depth 0 && | |
c8b29645 | 16 | blobsize=$((100*1024*1024)) && |
ca31f0b5 JS |
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" && | |
c680668d | 23 | #test-tool genrandom $i $blobsize && |
ca31f0b5 | 24 | printf "%-${blobsize}s" $i && |
95005262 | 25 | echo "M 100644 :$i $i" >> commit && |
ca31f0b5 JS |
26 | i=$(($i+1)) || |
27 | echo $? > exit-status | |
28 | done && | |
29 | echo "commit refs/heads/master" && | |
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) | | |
5eef828b | 35 | git fast-import --big-file-threshold=2 && |
ca31f0b5 JS |
36 | test ! -f exit-status |
37 | ||
38 | ' | |
39 | ||
d63ae319 | 40 | test_expect_success 'clone - bare' ' |
ca31f0b5 | 41 | |
c8b29645 RS |
42 | git clone --bare --no-hardlinks . clone-bare |
43 | ||
44 | ' | |
45 | ||
d63ae319 | 46 | test_expect_success 'clone - with worktree, file:// protocol' ' |
c8b29645 | 47 | |
f904f660 | 48 | git clone "file://$(pwd)" clone-wt |
ca31f0b5 JS |
49 | |
50 | ' | |
51 | ||
52 | test_done |