Re: [BUG] splitIndex with skipHash corrupts index and crashes status
- From
- Tanga Joris <tangajoris@gmail.com>
- Date
- Nov 7, 2026, 21:10 UTC
- Message-ID
- <CAKrRMNpaBrOybe0hw_B+RTZ5GWeUASpR+sRte0OLL2x6xJba8g@mail.gmail.com>
- In-Reply-To
- <20261107121119.2995843-1-andy.koppe@gmail.com>
Hi Andy,
Thank you for the bug report and the clear reproduction steps.
I was able to reproduce both cases on master (fb255012ac).
On Sat, 7 Nov 2026 at 15:16, Andy Koppe <andy.koppe@gmail.com> wrote:
Show 5 quoted lines
> $ ls .git | grep index > index > sharedindex.0000000000000000000000000000000000000000 > > Note the unexpected null OID.
It seems to be caused by write_shared_index() naming the file after the shared index's trailing checksum. With index.skipHash, that checksum is written as zeros, so the file is named sharedindex.0000000000000000000000000000000000000000, which is the file you saw.
The entries disappear because the split index then records a null base, and read_index_from() treats a null base as "no shared index" (read-cache.c:2381), so the entries stored in the shared index are lost.
I'm working on a fix and would be more than happy to send it, unless you are already working on one.
Thanks, Tanga