Re: [PATCH 1/5] rerere: avoid misrecording on a skipped or aborted rebase/am
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Dec 8, 2006, 21:28 UTC
- Message-ID
- <20061208212830.GB13944@localdomain>
- In-Reply-To
- <7v7ix2i0e5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
Show 20 quoted lines
> Eric Wong <normalperson@yhbt.net> writes:
>
> > +if (@ARGV && $ARGV[0] eq 'clear') {
> > + for my $path (keys %merge_rr) {
> > + my $name = $merge_rr{$path};
> > + if (-d "$rr_dir/$name") {
> > + rmtree(["$rr_dir/$name"]);
> > + }
> > + }
> > + unlink $merge_rr;
> > + exit 0;
> > +}
>
> Come to think of it, I am not sure about this one. Don't you
> need to make sure that there is no existing resolution before
> removing it? In other words, shouldn't the removal be like this?
>
> if (-d "$rr_dir/$name" && ! -f "$rr_dir/$name/postimage") {
> rmtree(["$rr_dir/$name"]);
> }Yes. However, it seems unlikely, that MERGE_RR would point to something that has a postimage. I suppose that a machine could crash or a user could've hit ^C at the correct millisecond that would cause rerere to not update MERGE_RR correctly.
Updated patches on the way (leaving out the status updates).