codex: avoid cwd lookup for absolute paths

This commit is contained in:
pakrym-oai
2026-04-06 23:10:11 -07:00
parent 4bddc4989b
commit a215cfe658
+6 -1
View File
@@ -63,7 +63,12 @@ impl AbsolutePathBuf {
/// Construct an absolute path from `path`, resolving relative paths against
/// the process current working directory.
pub fn relative_to_current_dir<P: AsRef<Path>>(path: P) -> std::io::Result<Self> {
Self::resolve_path_against_base(path, std::env::current_dir()?)
let path = path.as_ref();
if path.is_absolute() {
Self::from_absolute_path(path)
} else {
Self::resolve_path_against_base(path, std::env::current_dir()?)
}
}
pub fn join<P: AsRef<Path>>(&self, path: P) -> std::io::Result<Self> {