10
fi
11
12
test_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
-
13
+ git init 2gb-repo &&
14
+ (
15
+ cd 2gb-repo &&
16
+ git config pack.compression 0 &&
17
+ git config pack.depth 0 &&
18
+ blobsize=$((100*1024*1024)) &&
19
+ blobcount=$((2*1024*1024*1024/$blobsize+1)) &&
20
+ i=1 &&
21
+ (while test $i -le $blobcount
22
+ do
23
+ printf "Generating blob $i/$blobcount\r" >&2 &&
24
+ printf "blob\nmark :$i\ndata $blobsize\n" &&
25
+ #test-tool genrandom $i $blobsize &&
26
+ printf "%-${blobsize}s" $i &&
27
+ echo "M 100644 :$i $i" >> commit &&
28
+ i=$(($i+1)) ||
29
+ echo $? > exit-status
30
+ done &&
31
+ echo "commit refs/heads/main" &&
32
+ echo "author A U Thor <author@email.com> 123456789 +0000" &&
33
+ echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
34
+ echo "data 5" &&
35
+ echo ">2gb" &&
36
+ cat commit) |
37
+ git fast-import --big-file-threshold=2 &&
38
+ test ! -f exit-status
39
+ )
40
'
41
42
test_expect_success 'clone - bare' '
41
-
42
- git clone --bare --no-hardlinks . clone-bare
43
-
43
+ test_when_finished rm -rf clone-bare &&
44
+ git clone --bare --no-hardlinks 2gb-repo clone-bare
45
'
46
47
test_expect_success 'clone - with worktree, file:// protocol' '
47
-
48
- git clone "file://$(pwd)" clone-wt
49
-
48
+ test_when_finished rm -rf clone-wt &&
49
+ git clone "file://$(pwd)/2gb-repo" clone-wt
50
'
51
52
+rm -rf 2gb-repo 2>/dev/null
53
+
54
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'set up repo with >4GB object' '
55
large_blob_size=$((4*1024*1024*1024+1)) &&
56
git init --bare 4gb-repo &&
63
'
64
65
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone >4GB object via unpack-objects' '
66
+ test_when_finished rm -rf 4gb-clone-unpack &&
67
# The synthesized pack has five objects, so a large unpack limit keeps
68
# fetch-pack on the unpack-objects path.
69
git -c fetch.unpackLimit=100 clone --bare \
80
'
81
82
test_expect_success SIZE_T_IS_64BIT,EXPENSIVE 'clone with >4GB object via index-pack' '
83
+ test_when_finished rm -rf 4gb-clone-index &&
84
# Force fetch-pack to hand the pack to index-pack instead.
85
git -c fetch.unpackLimit=1 clone --bare \
86
"file://$(pwd)/4gb-repo" 4gb-clone-index &&