fragmentation/git

Values

pub fn write(
  fragment: fragmentation.Fragment,
  dir: String,
) -> Result(Nil, simplifile.FileError)

Write a fragment to disk under dir, named by its content-addressed SHA.

Computes the SHA via fragmentation.hash_fragment, serializes via fragmentation.serialize, then writes to <dir>/<sha>. Returns Ok(Nil) on success, Error(FileError) on failure. Idempotent: writing the same fragment twice produces the same file.

Search Document