Subject: Re: Bug in 2.48 with `git refs migrate`

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 13 Jan 2025 16:45:35 +0100

On Mon, Jan 13, 2025 at 01:56:33PM +0000, brian m. carlson wrote:
> If you remove the second block, it does not appear to reproduce.  Some
> investigation led me to the conclusion that the difference is when
> max_update_index is not 1, the header has the value 1 for it but the
> trailer has the correct value, and so we flag the header and trailer as
> mismatching and therefore it gets marked as corrupt.  I believe the
> reason things work when removing the second block is because that value
> remains 1, and so it works.

Hm. Makes me wonder whether this is caused by the newly added code to
also migrate reflog entries, as we'd play around with the update index
only when migrating those. Cc'ing Karthik so he can have a look.

> I haven't done anything else to investigate here, for which I apologize,
> but I just wanted to mention it while it was fresh on my mind.
> 
> In case this is helpful, I did see this when attempting to migrate two
> work repositories with lots of reflogs and many refs (the smaller has
> 2983 and the larger, 44832).  I obviously cannot send you these
> repositories or things in them, but I'm happy to test patches against
> them.
> 
> Please let me know if I can provide more useful information.

Thanks for your report!

Patrick