Repository navigation
fix(repo): refuse a push that moves a checked-out branch during a stopped merge, pick or rebase - #198
Merged
Merged
Conversation
…pped merge, pick or rebase LocalTransport::update_ref (sc push to a local path, and the wire UpdateRef) moved a branch with only a CAS/fast-forward gate. A push into a repo with a stopped merge/pick moved the checked-out tip from underneath it, and the completing commit then silently dropped the pushed work. It now refuses for the receiving repo's checked-out branch while one of those ops is in progress; other branches are unaffected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76a3a66270
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… HEAD during a stopped op Codex: a retry of a push that already landed (a lost response) must still succeed regardless of a stopped op, so the guard now runs after the already-at-that-id check; and HEAD is read only when an op is stopped, with a read failure then propagating instead of silently skipping the guard. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tonibergholm-codento
approved these changes
Oct 19, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Flagged at the P21 final review and still on the Deferred list:
LocalTransport::update_refmoves a branch tip with only a CAS/fast-forward gate and no in-progress check on the RECEIVING side. A push into a repo with a stopped merge or cherry-pick moves its checked-out tip from underneath the operation, and the completingsc commit(built from the working tree and the now-moved tip) silently drops the pushed commits (the P19-I1 discard shape, reached by a remote writer). A stopped rebase has its own moved-tip backstop; merge and pick completion did not.Change
update_ref(shared bysc pushto a local path and the wireUpdateRef, hencesc serve) refuses for the receiving repo's checked-out branch while a merge, cherry-pick or rebase is in progress there (MergeInProgress/PickInProgress/RebaseInProgress), before any write and inside the repo lock. Branches that are not checked out are unaffected, and the push is accepted again once the op is over.Verification
merge --abort.cargo fmt,cargo clippy --workspace --all-targets -D warnings,cargo test --workspace, and the push demos (remote, git remote, http, http auth, ssh, limits, partial clone, lazy fetch) pass.🤖 Generated with Claude Code
Summary by CodeRabbit