fix(git-backup): abort unfinished rebase on pull --rebase failure#35
Merged
Conversation
When backupToGit ran git pull --rebase before pushing, an unhandled rebase failure (cross-machine conflict, network blip) left the data-dir repo in an unfinished-rebase state. Every subsequent save then silently failed because git refuses new commits while a rebase is in progress. Now: detect non-zero exit, log the failure, run git rebase --abort to clean up, and skip the push (we'd just propagate desynced local state). Local saves continue working; only remote sync pauses until conflict is resolved. Found by adversarial review of v1.0.4 plan — the only guardrail-class bug actually likely to bite real users with cross-machine sync enabled. +1 regression test covering the new pull-conflict action. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Adversarial review of v1.0.4 plan caught the only guardrail-class bug actually likely to bite real users.
Bug
backupToGitrunsgit pull --rebasebefore pushing. If the rebase failed, the previous code didn't error-check it. Repo was left in unfinished-rebase state. Every subsequent save then silently failed because git refuses commits while a rebase is in progress.Fix
git rebase --abortto clean uppull-conflictaction so callers can distinguish from generic failuresUser-facing impact: local saves keep working; only remote sync pauses until conflict resolved. Next save retries cleanly.
Tests
+1 regression test. 107 → 108, all green.