Re: [PATCH 5/9] add test for streaming corrupt blobs

2013-03-27 Thread Jeff King
On Mon, Mar 25, 2013 at 04:21:34PM -0400, Jeff King wrote: +# Convert byte at offset $2 of object $1 into '\0' +corrupt_byte() { + obj_file=$(obj_to_file $1) + chmod +w $obj_file + printf '\0' | dd of=$obj_file bs=1 seek=$2 +} Hmm, this last line should probably be: diff

[PATCH 5/9] add test for streaming corrupt blobs

2013-03-25 Thread Jeff King
We do not have many tests for handling corrupt objects. This new test at least checks that we detect a byte error in a corrupt blob object while streaming it out with cat-file. Signed-off-by: Jeff King p...@peff.net --- t/t1060-object-corruption.sh | 34 ++ 1 file

Re: [PATCH 5/9] add test for streaming corrupt blobs

2013-03-25 Thread Jeff King
On Mon, Mar 25, 2013 at 02:10:38PM -0700, Jonathan Nieder wrote: +# convert 1234abcd to .git/objects/12/34abcd +obj_to_file() { + echo $(git rev-parse --git-dir)/objects/$(git rev-parse $1 | sed 's,..,/,') +} Maybe this would be clearer in multiple lines? commit=$(git