Repository navigation
fix(pull): survive stat-dirty staging files and surface merge failures - #31
Merged
Merged
Conversation
A tracked DSH atomic-write staging file (`.l2s.<payload>.<hash>.tmp<seq>.<seq>`) keeps the work tree stat-dirty while its content is unchanged, so `git merge` takes the autostash path and aborts with `fatal: stash failed`. The failure was then swallowed: a non-zero merge exit without MERGE_HEAD was read as "already up to date", `pull()` returned ok, and `lastError` kept an old push error forever. - exclude `.l2s.*` from the mirror and the delete set (host-private artifacts) - refresh the stat cache before merging - throw GIT_FAILED when a merge produced no MERGE_HEAD - clear `lastError` on the next successful pull/push - omit undefined keys from `sync_status` (lossless JSON) Fixes #29
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.
Reproduced the #29 mechanics from the report: a tracked DSH atomic-write staging file (
.l2s.<payload>.<hash>.tmp<seq>.<seq>) keeps the work tree stat-dirty while its content is unchanged, sogit mergetakes the autostash path and aborts withfatal: stash failed.The failure was then invisible:
beginMergeread a non-zero merge exit withoutMERGE_HEADas “already up to date”, sopull()returnedok: true,lastPullAtadvanced, andlastErrorkept a days-old push error while the repo stayed divergent.Fixes, each with a regression test:
.l2s.*is now a host-private artifact — excluded from the mirror and from the delete set, so it never reaches another device.git update-index -q --refreshruns before every merge (whitelisted as refresh-only).GIT_FAILEDwith the sanitized stderr tail instead of masquerading as a no-op.lastError.sync_statusomits undefined keys (lastPullAt/lastPushAt/lastError, plushead/remoteHead/erroron an empty repo), fixing thevalue is not lossless JSONrejection.Fixes #29