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

Function main_worktree_root

atomic-cli/src/commands/git/linked_worktree.rs:155–160  ·  view source on GitHub ↗
(common_dir: &Path)

Source from the content-addressed store, hash-verified

153}
154
155fn main_worktree_root(common_dir: &Path) -> PathBuf {
156 match (common_dir.file_name(), common_dir.parent()) {
157 (Some(name), Some(parent)) if name == GIT_DIR_NAME => parent.to_path_buf(),
158 _ => common_dir.to_path_buf(),
159 }
160}
161
162fn canonical_or_raw(path: &Path) -> PathBuf {
163 fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf())

Callers 1

detect_linked_worktreeFunction · 0.85

Calls 2

parentMethod · 0.80
file_nameMethod · 0.45

Tested by

no test coverage detected