Re: [PATCH v4 2/2] interpret-trailers: add option for in-place editing
Tobias Klauser <tklauser@distanz.ch> writes:
Show 23 quoted lines
>> > +test_expect_success POSIXPERM,SANITY "in-place editing doesn't clobber original file on error" '
>> > + cat basic_message >message &&
>> > + chmod -r message &&
>> > + test_must_fail git interpret-trailers --trailer "Reviewed-by: Alice" --in-place message &&
>> > + chmod +r message &&
>> > + test_cmp message basic_message
>> > +'
>>
>> If for some reason interpret-trailers fails to fail, this would
>> leave an unreadable 'message' in the trash directory. Maybe no
>> other tests that come after this one want to be able to read the
>> contents of the file right now, but this is an accident waiting to
>> happen:
>>
>> cat basic_message >message &&
>> + test_when_finished "chmod +r message" &&
>> chmod -r message &&
>> test_must_fail ... &&
>> chmod +r message &&
>> test_cmp ...
>
> Indeed, I forgot about this. I saw you already folded in the missing
> 'chmod +r message' in your tree. Thanks for that!
I did no such thing, though.