From: Jeff King Date: Wed, 27 Mar 2013 20:27:05 GMT Subject: Re: [PATCH 5/9] add test for streaming corrupt blobs Message-ID: <20130327202705.GA5145@sigill.intra.peff.net> In-Reply-To: <20130325202134.GE16019@sigill.intra.peff.net> 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 --git a/t/t1060-object-corruption.sh b/t/t1060-object-corruption.sh index a84deb1..3f87051 100755 --- a/t/t1060-object-corruption.sh +++ b/t/t1060-object-corruption.sh @@ -12,7 +12,7 @@ corrupt_byte() { corrupt_byte() { obj_file=$(obj_to_file "$1") && chmod +w "$obj_file" && - printf '\0' | dd of="$obj_file" bs=1 seek="$2" + printf '\0' | dd of="$obj_file" bs=1 seek="$2" conv=notrunc } test_expect_success 'setup corrupt repo' ' The intent was to change a single byte, not truncate the file (though on the plus side, that truncation is what found the other bugs). -Peff