Skip to content

Commit f77b2ff

Browse files
committed
t: add an expensive test to verify that 4GB+ blobs can be staged/read
I should have added this test as soon as git-for-windows#6012 was opened. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent a60a705 commit f77b2ff

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

t/t3706-add-4gb-file.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2026 Johannes Schindelin
4+
#
5+
6+
test_description='add 4GB+ objects'
7+
8+
. ./test-lib.sh
9+
10+
size_4gb=4294967296
11+
12+
test_expect_success EXPENSIVE 'set up a 4GB file' '
13+
test_atexit "rm -f large" &&
14+
# genrandom takes only an unsigned long...
15+
test-tool genrandom 123 $(($size-1)) >large &&
16+
printf 1 >>large
17+
'
18+
19+
test_expect_success 'add 4GB file' '
20+
git add large &&
21+
git cat-file -s :large >size-staged &&
22+
test $size_4gb = $(cat size-staged)
23+
'
24+
test_expect_success 'read 4GB loose object' '
25+
git -P show :large >read &&
26+
test_file_size read >size-read &&
27+
test $size_4gb = $(cat size-read)
28+
'
29+
30+
test_done
31+

0 commit comments

Comments
 (0)