Skip to main content

commit_paths_to_memstead_at_gitdir

Function commit_paths_to_memstead_at_gitdir 

Source
pub fn commit_paths_to_memstead_at_gitdir(
    gitdir: &Path,
    edits: &[(String, Option<Vec<u8>>)],
    ctx: &CommitContext<'_>,
    message: &str,
) -> Result<(), MemRepoWriteError>
Expand description

Commit a batch of tree edits (upsert or remove) to arbitrary paths on the unified __MEMSTEAD ref in one commit. The pipeline-edit provenance path: .memstead/ pipeline configs are plain disk JSON with no commit of their own, so each edit mirrors its config bytes under __MEMSTEAD:pipeline/<kind>/<mem>/<name>.json — the commit (subject + Note: trailer from ctx) IS the provenance record; the disk file stays the read path. Same read-modify-write shape and atomic ref advance as commit_config_to_memstead_at_gitdir, generalized to N paths so a rename (remove old + upsert new) lands as one commit.

edits: (tree_path, Some(bytes)) upserts, (tree_path, None) removes. Missing-__MEMSTEAD bootstrap follows the config helper’s race-safe MustNotExist creation.