Function
default_local_worktree_path
(root: &Path, branch: &str)
Source from the content-addressed store, hash-verified
| 584 | } |
| 585 | |
| 586 | fn default_local_worktree_path(root: &Path, branch: &str) -> PathBuf { |
| 587 | let repo_name = root |
| 588 | .file_name() |
| 589 | .map(|name| name.to_string_lossy().to_string()) |
| 590 | .unwrap_or_else(|| "repo".to_string()); |
| 591 | root.parent() |
| 592 | .unwrap_or(root) |
| 593 | .join(format!("{repo_name}-{branch}")) |
| 594 | } |
| 595 | |
| 596 | pub(super) fn normalize_local_path(root: &Path, input: &str) -> Result<WorkspacePath> { |
| 597 | let input = default_path_input(input); |
Tested by
no test coverage detected