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

Function tracked_worktree_path

atomic-repository/src/repository/status.rs:1352–1358  ·  view source on GitHub ↗

Decode only at the filesystem boundary; callers retain stored keys for graph lookup and status entries. Reject decoded traversal/absolute paths.

(path: &Path)

Source from the content-addressed store, hash-verified

1350// Decode only at the filesystem boundary; callers retain stored keys for
1351// graph lookup and status entries. Reject decoded traversal/absolute paths.
1352fn tracked_worktree_path(path: &Path) -> PathBuf {
1353 path.to_str()
1354 .and_then(|text| super::project_tree::unescape_repo_path(text).ok())
1355 .and_then(|bytes| super::RepoPath::new(bytes).ok())
1356 .and_then(|path| path.to_native().ok())
1357 .unwrap_or_else(|| path.to_path_buf())
1358}
1359
1360#[cfg(all(test, unix))]
1361mod change_source_convergence_tests {

Callers 1

status_innerMethod · 0.85

Calls 3

unescape_repo_pathFunction · 0.85
to_nativeMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected