Skip to main content

Module worktree_copy_install_entry

Module worktree_copy_install_entry 

Source
Expand description

The exclusive creation of one destination entry from the stage, and the identity captured after it. What: The exclusive creation of one destination entry from the private stage, the identity captured right after it exists, and the creation of the unselected parent directories an entry needs. Why: A regular file is installed as a hard link to its staged copy, so it appears with its final bytes and mode in one step; the identity captured after creation is the only proof later rollback accepts.

In TS you’d write (pseudocode):

await ensureParents({ destinationRoot, entry, created });
await createSelectedEntry({ snapshot, destinationRoot, entry });
created.push(await captureInstalledPath({ destinationPath, relativePath, selected: true }));

Structs§

InstalledPath
What: One path cli-git created, with the identity the filesystem gave it. Why: Rollback removes a path only when its device and inode still match this record.

Functions§

capture_installed_path
What: The no-follow identity of a path, read right after its creation. Why: The identity names the exact object cli-git made, not whatever later sits at the same path.
create_selected_entry
What: Creates one absent selected entry from the private stage, as its kind requires. Why: Directories are created private and changed later; links are recreated with their exact target text.
ensure_parents
What: Creates each missing unselected parent directory of one entry, shallow first, recording what it created. Why: An entry’s parents are scaffolding that rollback must be able to remove again, so each one is recorded.