Skip to content

Use: remaining file/folder swap edge cases (after #263–#265) #266

Open

Description

@SitgesRun

After #263, #264 and #265, "Use" restores an object's own folder as of a past result (doc/protocol.md section 5). Each Codex review found another case where a file and a folder change places. Per master on 2026-11-15, the remaining ones are tracked here, not fixed before 0.3.0: they are not normal use, which is the merge standard.

Covered and tested (entryActions.test.ts, the Use test with "a file added since")

Not covered (known or likely)

  • A historical file where a non-empty folder holding files no commit tracks stands. rmdir refuses, so the Use fails with an error and nothing is half written, since the write queue fails the change.
  • A path in the folder that is a link now or was then: the link check refuses it as no path of the project.
  • A case-only rename between the result and now (Notes.md / notes.md) on a case-insensitive disk.
  • A receipt and its output across such a swap: ordering is deletions, then receipts, then outputs, but this is untested.

To do

Write each as a failing test first, and fix it with git's own semantics as the model (a checkout of the object's tree, dir.c remove_path, unpack-trees' "would be overwritten" check).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions