This repository was archived by the owner on May 13, 2026. It is now read-only.
Fix four bugs: packfile offset tracking, HTTP error ordering, ref ordering, and race condition#1
Merged
Merged
Conversation
…ering, and race condition - packfile.go: ReadObject now uses a countingReader to track compressed bytes consumed and properly advances r.offset, fixing sequential multi-object reads. - handlers.go: Use commitSHA from GenerateCommit directly instead of re-reading refs, which fixes both the HTTP error-after-body-written issue and ensures HEAD is always advertised first (Git protocol requirement). - commit.go: GenerateCommit now holds the repo lock for the entire read-modify-write cycle, preventing concurrent generates from reading the same parent and losing ref updates. - repo.go: Added Lock/Unlock/GetRefsLocked methods to support holding the mutex across multiple repo operations. https://claude.ai/code/session_015F9BYQoCy2P2zYZBuVeXHH
Runs build, tests (with race detector), and go vet. https://claude.ai/code/session_015F9BYQoCy2P2zYZBuVeXHH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bytes consumed and properly advances r.offset, fixing sequential
multi-object reads.
re-reading refs, which fixes both the HTTP error-after-body-written
issue and ensures HEAD is always advertised first (Git protocol
requirement).
read-modify-write cycle, preventing concurrent generates from reading
the same parent and losing ref updates.
the mutex across multiple repo operations.
https://claude.ai/code/session_015F9BYQoCy2P2zYZBuVeXHH