diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-02-02 21:47:51 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-02-02 21:47:51 -0800 |
commit | d3b91fad1843e98fde9c287f72315bd456e18f2c (patch) | |
tree | 4655f38776fcb76c4b9470f7d2e79b9bf6938948 /t | |
parent | b659b49bb0ee8995ddc4730e1796866baccc39be (diff) | |
parent | 844ad3d9a0418b4a3a6a944a50d65403121a0eb6 (diff) | |
download | git-d3b91fad1843e98fde9c287f72315bd456e18f2c.tar.gz git-d3b91fad1843e98fde9c287f72315bd456e18f2c.tar.xz |
Merge branch 'sp/fast-import-large-blob'
* sp/fast-import-large-blob:
fast-import: Stream very large blobs directly to pack
Diffstat (limited to 't')
-rwxr-xr-x | t/t5705-clone-2gb.sh | 2 | ||||
-rwxr-xr-x | t/t9300-fast-import.sh | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/t/t5705-clone-2gb.sh b/t/t5705-clone-2gb.sh index 9f52154ca..adfaae8c5 100755 --- a/t/t5705-clone-2gb.sh +++ b/t/t5705-clone-2gb.sh @@ -31,7 +31,7 @@ test_expect_success 'setup' ' echo "data 5" && echo ">2gb" && cat commit) | - git fast-import && + git fast-import --big-file-threshold=2 && test ! -f exit-status ' diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 60d6f5d1b..131f03298 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -1536,4 +1536,50 @@ test_expect_success 'R: ignore non-git options' ' git fast-import <input ' +## +## R: very large blobs +## +blobsize=$((2*1024*1024 + 53)) +test-genrandom bar $blobsize >expect +cat >input <<INPUT_END +commit refs/heads/big-file +committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE +data <<COMMIT +R - big file +COMMIT + +M 644 inline big1 +data $blobsize +INPUT_END +cat expect >>input +cat >>input <<INPUT_END +M 644 inline big2 +data $blobsize +INPUT_END +cat expect >>input +echo >>input + +test_expect_success \ + 'R: blob bigger than threshold' \ + 'test_create_repo R && + git --git-dir=R/.git fast-import --big-file-threshold=1 <input' +test_expect_success \ + 'R: verify created pack' \ + ': >verify && + for p in R/.git/objects/pack/*.pack; + do + git verify-pack -v $p >>verify || exit; + done' +test_expect_success \ + 'R: verify written objects' \ + 'git --git-dir=R/.git cat-file blob big-file:big1 >actual && + test_cmp expect actual && + a=$(git --git-dir=R/.git rev-parse big-file:big1) && + b=$(git --git-dir=R/.git rev-parse big-file:big2) && + test $a = $b' +test_expect_success \ + 'R: blob appears only once' \ + 'n=$(grep $a verify | wc -l) && + test 1 = $n' + test_done |