#2425·go-git

Investigate intermittent RepackObjects pack checksum mismatch

Author: SophCreated Sep 25, 2026Updated Sep 25, 2026

TestRepositorySuite/TestRepackObjects intermittently fails with malformed pack file: checksum mismatch during RepackObjects.

Observed on #2424, oldstable/macOS (Go 1.26.8): https://github.com/go-git/go-git/actions/runs/36169800705/job/108186281526

The pack writer builds its index using a background parser while the encoder writes the pack. We suspect a timing-sensitive problem in that write/read/validation path, but have not established whether the completed pack is corrupt or streaming validation is incorrect. The reference-prefix changes in #2424 do not appear to explain this failure.

Local macOS stress runs have not reproduced it (100 repetitions on Go 1.27.1 and two batches of 100 on Go 1.26.8). Proposed next step: failure-only test diagnostics that preserve temporary packs, independently check SHA-1, rescan completed bytes, and upload CI artifacts. This is an investigation, not a proposed correctness fix.

AI assistance: investigation and diagnostic code assisted by OpenAI ChatGPT.