Skip to content

Possible host commit with a file and a directory at the same path when a protected file is missing from disk (unreproduced; flagged reviewing #276) #278

Closed

Description

@tonibergholm-codento

Flagged by the independent reviewer of #276; predates it and was NOT reproduced. When a protected file is missing from disk during commit (e.g. a workspace or checkout made without a key, or a protected path skipped as absent) a host commit can end up with a file secret and a directory secret/ at the same path. Needs: a reproduction (protected path present as a file in one side/tree and a directory in the other with the protected path carried as absent), then a guard in snapshot assembly (snapshot_files, the carry of absent protected paths) that refuses or resolves the file/directory collision before writing the tree; tests for ws harvest, merge completion and plain commit.

Activity

  1. tonibergholm-codento commented on Oct 21, 2026

    @tonibergholm-codento
    CollaboratorAuthor

    Reproduced, not just defensive: commit, merge completion and ws harvest all produced a snapshot with a file and a directory at one path (absent protected file, or out-of-sparse file, plus a directory created at that path). ws refresh and sc work share the path. Fixed in #280 by refusing in the single tree builder (FileDirCollision naming both paths, nothing written, no ref moved). Tests in crates/repo/src/file_dir_collision.rs.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions