Repository navigation
fix(rebase): handle upstream submodule updates - #93
Merged
cheat2001 merged 3 commits intoNov 14, 2026
Merged
Conversation
Use a temporary in-memory index during replay commits so an unchanged submodule checkout does not block rebase or Continue. Keep normal dirty-file checks and restore the repository index on every exit path. Add regression coverage for pull modes, older-client recovery, conflicts, abort, hooks, gitlink resolution and failed commits. Fixes cheat2001#89.
Recover eligible submodule checkouts from the original rebase tree when no app baseline exists. Save baselines across pauses and failed attempts so intentional checkout moves remain excluded from automatic updates. Exercise recovery through the app wrapper, require an updated checkout before post-rewrite and verify Stage all cannot revert the upstream gitlink. Cover retry, deliberate moves, blocked replay and invalid recovery metadata.
Publish synced baseline snapshots through an atomic tempfile replacement and preserve rebase outcomes when saving recovery metadata fails. Keep the old snapshot intact on partial writes. Try normal replay commits before inspecting submodules and retain the original libgit2 error when optional inspection fails. Cover atomic publication, partial write failures, conflict and blocker outcomes, and intermediate malformed gitmodules.
cheat2001
approved these changes
Nov 14, 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.
What & why
Pull with rebase fails when upstream changes a submodule's recorded commit and the local branch has commits to replay. The parent index advances while the submodule checkout stays at its old commit, so libgit2 refuses each replay commit with “unstaged changes exist in workdir.” Continue rebase hits the same failure.
This fixes rebase, explicit/configured Pull with rebase, and Continue, including a rebase left stuck by an older client. Closes #89.
Implementation
Validation
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo test: 323 passed on macOS — 112 unit tests, 210 engine tests and one clone-hook test. Run with an isolated test home/Git configuration; local TCP fixtures ran outside the sandbox.pnpm typecheckandpnpm test: all workspace typechecks and 341 frontend tests pass.git diff --checkScreenshots
Not applicable; no UI changes.
Checklist
pnpm typecheck && pnpm testpasscargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo testpasstests/git_engine.rsCLAUDE.mdupdated