MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / save_downloaded_change

Function save_downloaded_change

atomic-cli/src/commands/pull/helpers.rs:195–199  ·  view source on GitHub ↗

Save a downloaded change to the repository's change store. Writes the change data to the appropriate location in the repository's `.atomic/changes/` directory structure. # Arguments `repo` - The repository to save to `hash` - The expected hash of the change (for verification) `data` - The raw change file data # Returns `Ok(())` on success, or an appropriate error. # Errors - `CliError::Inte

(repo: &Repository, hash: &Hash, data: Bytes)

Source from the content-addressed store, hash-verified

193/// save_downloaded_change(&repo, &expected_hash, data)?;
194/// ```
195pub fn save_downloaded_change(repo: &Repository, hash: &Hash, data: Bytes) -> CliResult<()> {
196 repo.import_change_bytes(hash, &data)
197 .map(|_| ())
198 .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to save change: {}", e)))
199}
200
201// Error Conversion
202

Callers 1

run_asyncMethod · 0.70

Calls 1

import_change_bytesMethod · 0.80

Tested by

no test coverage detected