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

Function add_change_store

atomic-repository/src/repository/database.rs:175–189  ·  view source on GitHub ↗
(legacy: &mut LegacyDatabases, dot_dir: &Path)

Source from the content-addressed store, hash-verified

173}
174
175fn add_change_store(legacy: &mut LegacyDatabases, dot_dir: &Path) -> Result<(), RepositoryError> {
176 let changes = dot_dir.join(LEGACY_CHANGE_STORE_FILE);
177 if !changes.is_file() {
178 return Ok(());
179 }
180 legacy.add(&changes).map_err(|error| {
181 if is_already_open(&error) {
182 RepositoryError::LegacyChangeStoreBusy {
183 path: changes.display().to_string(),
184 }
185 } else {
186 error.into()
187 }
188 })
189}
190
191/// Move the legacy files this process holds into `.atomic/legacy/<name>/`.
192///

Callers 1

ensure_databaseFunction · 0.85

Calls 4

is_already_openFunction · 0.85
displayMethod · 0.80
is_fileMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected