From: Junio C Hamano Date: Thu, 22 Jun 2017 19:03:31 GMT Subject: Re: Truncating HEAD reflog on branch move Message-ID: In-Reply-To: <20170622184516.kq3y7nxwohm3coq4@sigill.intra.peff.net> Jeff King writes: > 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.