Jeff King writes:
> 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"
>> +}
>
>
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 p
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?
>
>
Jeff King wrote:
> 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.
Thanks.
[...]
> +# convert "1234abcd" to ".git/objects/12/34abcd"
> +obj_to_file() {
> + ech
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
---
t/t1060-object-corruption.sh | 34 ++
1 file changed, 34 i
5 matches
Mail list logo