You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sparse + private branch: a conflicted merge-in resurrects a file the public side deleted outside the view #240
Found while reviewing #239 (the same class as #238, in the private-branch path). Not fixed in #239.
Symptom: a conflicted merge of a public branch into a private branch, under a sparse spec, resurrects a file the public side deleted cleanly outside the view. Without sparse the file stays deleted.
Reproduced with a scratch test in crates/repo/src/private.rs (not committed):
main has src/lib.rs, docs/old.txt, docs/mod.txt. Create private branch fix; edit src/lib.rs on it and commit_private.
On main: edit src/lib.rs differently, delete docs/old.txt, edit docs/mod.txt, commit.
set_sparse(["src/"]) on main, switch to fix, merge_into_private("main") -> MergeConflicts(1). Resolve src/lib.rs, commit_private.
Switch to main, widen the spec to src/ and docs/ (remove the leftover docs/mod.txt first), switch back to fix.
Result with sparse: docs/old.txt exists again. Without the set_sparse calls it does not.
Cause (from reading crates/repo/src/private.rs ~:738-747):merge_into_private writes merge_state with no decided root (~:1354) and completes through commit_private. There, "carry prior paths that are expected-absent" copies every prior-tip path that is out of the sparse view and absent from disk. The merge removed docs/old.txt from disk, so the prior tip's copy is carried back. This is the #238 mechanism, with the prior private tip instead of the parents.
Side finding: the conflict stop wrote docs/mod.txt (out of view) to disk, so the merge-in path does not honor the sparse spec when laying out its result. That is why the out-of-view modify landed in the repro; it is also a view wider than advertised. Worth checking against the "private branches refuse sparse *" boundary: set_sparse is refused on a private branch, but a spec set on the public branch before the switch still applies.
Direction: record a decided root for the private merge stop (the merged inner tree) and carry out-of-view paths from it in commit_private when a merge head is set, as snapshot_files now does for public branches; or decide that a sparse spec and a private branch should not combine and refuse the switch.
Activity
fix(repo): re-derive the private merge outcome on every completion, n…
test(repo): assert the fixture roots are gone (#240)
fix(repo): drop stale plaintext at a private stop and read decided pa…
test(repo): assert the protected-merge fixture root is gone (#240)
fix(repo): refuse an untracked collision and fail on removal errors a…
fix(repo): treat a symlink at a stale protected path as the user's fi…
fix(repo): decide out-of-view paths by the merge on a sparse private …
docs: drop #240 from Deferred and point ADR-0034/0044 status at the m…
docs: sync CLAUDE.md, ROADMAP, THREAT-MODEL, skill reference and ADR …