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

Function observe_locks

atomic-cli/src/commands/git/observation.rs:1217–1232  ·  view source on GitHub ↗
(paths: &GitAdminPaths)

Source from the content-addressed store, hash-verified

1215}
1216
1217fn observe_locks(paths: &GitAdminPaths) -> Result<LockObservation, ObservationError> {
1218 let index_lock_path = append_suffix(&paths.index_path, ".lock");
1219 let index_lock = observe_path(index_lock_path)?;
1220 let mut ref_locks = BTreeSet::new();
1221
1222 for admin_dir in [&paths.common_dir, &paths.worktree_git_dir] {
1223 collect_top_level_locks(admin_dir, &mut ref_locks)?;
1224 collect_locks_recursive(&admin_dir.join("refs"), &mut ref_locks)?;
1225 }
1226 ref_locks.remove(&index_lock.path);
1227
1228 Ok(LockObservation {
1229 index_lock,
1230 ref_locks: ref_locks.into_iter().collect(),
1231 })
1232}
1233
1234fn collect_top_level_locks(
1235 directory: &Path,

Callers 1

observe_open_repositoryFunction · 0.85

Calls 7

append_suffixFunction · 0.85
collect_locks_recursiveFunction · 0.85
observe_pathFunction · 0.70
collect_top_level_locksFunction · 0.70
removeMethod · 0.65
collectMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected