(
root: &std::path::Path,
relative: &str,
)
| 3108 | /// feature build cannot reach outside the worktree or smuggle options. |
| 3109 | #[cfg(feature = "adoption-test-injection")] |
| 3110 | fn injection_relative_path( |
| 3111 | root: &std::path::Path, |
| 3112 | relative: &str, |
| 3113 | ) -> Result<std::path::PathBuf, RepositoryError> { |
| 3114 | let path = std::path::Path::new(relative); |
| 3115 | if relative.is_empty() |
| 3116 | || path.is_absolute() |
| 3117 | || path |
| 3118 | .components() |
| 3119 | .any(|component| component == std::path::Component::ParentDir) |
| 3120 | { |
| 3121 | return Err(RepositoryError::InvalidOperation { |
| 3122 | message: format!("test injection path must stay inside the worktree: {relative:?}"), |
| 3123 | }); |
| 3124 | } |
| 3125 | Ok(root.join(path)) |
| 3126 | } |
| 3127 | |
| 3128 | /// R7: one level of the unexplained-worktree scan. Every observation error |
| 3129 | /// is propagated (`Err`), never swallowed: a partial scan cannot establish |
no test coverage detected