Re: Truncating HEAD reflog on branch move
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 22, 2017, 19:03 UTC
- Message-ID
- <xmqqvannkfp8.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170622184516.kq3y7nxwohm3coq4@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> I don't think this is quite right, though. We've decremented "recno" > after assigning the old pointer to "reflog". So in the existing code, > "reflog" in that second conditional pointing to the _next_ entry (or > previous, really, since we are going in reverse order). > > So I think you'd need to look at commit->reflog again (after checking > that we didn't go past the start of the array).
Perhaps. I did the illustration that way simply because I was not sure if the current "the entry was NULL from something new, so skip and look at the previous entry's new" was correct to begin with.