Re: [PATCH v4 2/2] interpret-trailers: add option for in-place editing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016-01-15 at 18:24:49 +0100, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Tobias Klauser <tklauser@xxxxxxxxxx> writes:
> 
> >> > +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.

Sorry, my misunderstanding. I thought about "chmod +r" but of course the
essential part is the

  +       test_when_finished "chmod +r message" &&

which isn't in your tree.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]