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)
| 193 | /// save_downloaded_change(&repo, &expected_hash, data)?; |
| 194 | /// ``` |
| 195 | pub 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 |
no test coverage detected