Merge branches 'jc/convert', 'jc/bigfile' and 'jc/replacing' into jc/streaming

* jc/convert:
  convert: make it harder to screw up adding a conversion attribute
  convert: make it safer to add conversion attributes
  convert: give saner names to crlf/eol variables, types and functions
  convert: rename the "eol" global variable to "core_eol"

* jc/bigfile:
  Bigfile: teach "git add" to send a large file straight to a pack
  index_fd(): split into two helper functions
  index_fd(): turn write_object and format_check arguments into one flag

* jc/replacing:
  read_sha1_file(): allow selective bypassing of replacement mechanism
  inline lookup_replace_object() calls
  read_sha1_file(): get rid of read_sha1_file_repl() madness
  t6050: make sure we test not just commit replacement
  Declare lookup_replace_object() in cache.h, not in commit.h
This commit is contained in:
Junio C Hamano
2011-05-15 16:30:13 -07:00
15 changed files with 293 additions and 144 deletions

27
t/t1050-large.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Copyright (c) 2011, Google Inc.
test_description='adding and checking out large blobs'
. ./test-lib.sh
test_expect_success setup '
git config core.bigfilethreshold 200k &&
echo X | dd of=large bs=1k seek=2000
'
test_expect_success 'add a large file' '
git add large &&
# make sure we got a packfile and no loose objects
test -f .git/objects/pack/pack-*.pack &&
test ! -f .git/objects/??/??????????????????????????????????????
'
test_expect_success 'checkout a large file' '
large=$(git rev-parse :large) &&
git update-index --add --cacheinfo 100644 $large another &&
git checkout another &&
cmp large another ;# this must not be test_cmp
'
test_done

View File

@@ -236,6 +236,20 @@ test_expect_success 'index-pack and replacements' '
git index-pack test-*.pack
'
#
#
test_expect_success 'not just commits' '
echo replaced >file &&
git add file &&
REPLACED=$(git rev-parse :file) &&
mv file file.replaced &&
echo original >file &&
git add file &&
ORIGINAL=$(git rev-parse :file) &&
git update-ref refs/replace/$ORIGINAL $REPLACED &&
mv file file.original &&
git checkout file &&
test_cmp file.replaced file
'
test_done