t1050-large: generate large files without dd
For some unknown reason, the dd on my Windows box segfaults randomly, but since recently, it does so much more often than it used to, which makes running the test suite burdensome. Use printf to write large files instead of dd. To emphasize that three of the large blobs are exact copies, use cp to allocate them. The new code makes the files a bit smaller, and they are not sparse anymore, but the tests do not depend on these properties. We do not want to use test-genrandom here (which is used to generate large files elsewhere in t1050), so that the files can be compressed well (which keeps the run-time short). The files are now large text files, not binary files. But since they are larger than core.bigfilethreshold they are diagnosed as binary by Git. For this reason, the 'git diff' tests that check the output for "Binary files differ" still pass. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
fdf96a20ac
commit
d0a042a186
@ -9,10 +9,10 @@ test_expect_success setup '
|
|||||||
# clone does not allow us to pass core.bigfilethreshold to
|
# clone does not allow us to pass core.bigfilethreshold to
|
||||||
# new repos, so set core.bigfilethreshold globally
|
# new repos, so set core.bigfilethreshold globally
|
||||||
git config --global core.bigfilethreshold 200k &&
|
git config --global core.bigfilethreshold 200k &&
|
||||||
echo X | dd of=large1 bs=1k seek=2000 &&
|
printf "%2000000s" X >large1 &&
|
||||||
echo X | dd of=large2 bs=1k seek=2000 &&
|
cp large1 large2 &&
|
||||||
echo X | dd of=large3 bs=1k seek=2000 &&
|
cp large1 large3 &&
|
||||||
echo Y | dd of=huge bs=1k seek=2500 &&
|
printf "%2500000s" Y >huge &&
|
||||||
GIT_ALLOC_LIMIT=1500k &&
|
GIT_ALLOC_LIMIT=1500k &&
|
||||||
export GIT_ALLOC_LIMIT
|
export GIT_ALLOC_LIMIT
|
||||||
'
|
'
|
||||||
@ -61,7 +61,7 @@ test_expect_success 'checkout a large file' '
|
|||||||
large1=$(git rev-parse :large1) &&
|
large1=$(git rev-parse :large1) &&
|
||||||
git update-index --add --cacheinfo 100644 $large1 another &&
|
git update-index --add --cacheinfo 100644 $large1 another &&
|
||||||
git checkout another &&
|
git checkout another &&
|
||||||
cmp large1 another ;# this must not be test_cmp
|
test_cmp large1 another
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'packsize limit' '
|
test_expect_success 'packsize limit' '
|
||||||
@ -162,7 +162,7 @@ test_expect_success 'pack-objects with large loose object' '
|
|||||||
test_create_repo packed &&
|
test_create_repo packed &&
|
||||||
mv pack-* packed/.git/objects/pack &&
|
mv pack-* packed/.git/objects/pack &&
|
||||||
GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
|
GIT_DIR=packed/.git git cat-file blob $SHA1 >actual &&
|
||||||
cmp huge actual
|
test_cmp huge actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'tar achiving' '
|
test_expect_success 'tar achiving' '
|
||||||
|
Loading…
Reference in New Issue
Block a user