]>
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 | ||
2c7e134c ÆAB |
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 | |
11 | fi | |
ca31f0b5 | 12 | |
2c7e134c | 13 | test_expect_success CLONE_2GB 'setup' ' |
ca31f0b5 JS |
14 | |
15 | git config pack.compression 0 && | |
16 | git config pack.depth 0 && | |
c8b29645 | 17 | blobsize=$((100*1024*1024)) && |
ca31f0b5 JS |
18 | blobcount=$((2*1024*1024*1024/$blobsize+1)) && |
19 | i=1 && | |
20 | (while test $i -le $blobcount | |
21 | do | |
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) | | |
5eef828b | 36 | git fast-import --big-file-threshold=2 && |
ca31f0b5 JS |
37 | test ! -f exit-status |
38 | ||
39 | ' | |
40 | ||
2c7e134c | 41 | test_expect_success CLONE_2GB 'clone - bare' ' |
ca31f0b5 | 42 | |
c8b29645 RS |
43 | git clone --bare --no-hardlinks . clone-bare |
44 | ||
45 | ' | |
46 | ||
2c7e134c | 47 | test_expect_success CLONE_2GB 'clone - with worktree, file:// protocol' ' |
c8b29645 RS |
48 | |
49 | git clone file://. clone-wt | |
ca31f0b5 JS |
50 | |
51 | ' | |
52 | ||
53 | test_done |