Merge remote-tracking branch 'origin/main' into pakrym/core-cwd-absolutepathbuf

# Conflicts:
#	codex-rs/core/src/tools/runtimes/apply_patch.rs
#	codex-rs/core/src/tools/runtimes/apply_patch_tests.rs
#	codex-rs/core/tests/common/lib.rs
#	codex-rs/tui/src/test_support.rs
This commit is contained in:
pakrym-oai
2026-04-07 14:34:21 -07:00
71 changed files with 1449 additions and 621 deletions
+1 -32
View File
@@ -1,37 +1,6 @@
use codex_utils_absolute_path::AbsolutePathBuf;
use std::path::Path;
pub(crate) use codex_utils_absolute_path::test_support::PathBufExt;
use std::path::PathBuf;
pub(crate) trait PathExt {
fn abs(&self) -> AbsolutePathBuf;
}
impl PathExt for Path {
fn abs(&self) -> AbsolutePathBuf {
if let Ok(path) = AbsolutePathBuf::try_from(self.to_path_buf()) {
return path;
}
if cfg!(windows)
&& let Some(path) = self.to_str()
&& path.starts_with('/')
{
return AbsolutePathBuf::try_from(test_path_buf(path))
.expect("windows test path should be absolute");
}
panic!("path should already be absolute");
}
}
pub(crate) trait PathBufExt {
fn abs(&self) -> AbsolutePathBuf;
}
impl PathBufExt for PathBuf {
fn abs(&self) -> AbsolutePathBuf {
self.as_path().abs()
}
}
pub(crate) fn test_path_display(path: &str) -> String {
test_path_buf(path).abs().display().to_string()
}