Migrate ExecutorFileSystem read_file to PathUri

This commit is contained in:
Codex
2026-06-10 22:14:42 +00:00
committed by Adam Perry
parent 7f26bca739
commit df0f70f7b3
41 changed files with 509 additions and 61 deletions
+1
View File
@@ -14,6 +14,7 @@ chrono = { workspace = true }
codex-file-system = { workspace = true }
codex-protocol = { workspace = true }
codex-utils-absolute-path = { workspace = true }
codex-utils-path-uri = { workspace = true }
futures = { workspace = true, features = ["alloc"] }
gix = { workspace = true }
once_cell = { workspace = true }
+6 -1
View File
@@ -6,6 +6,7 @@ use std::path::PathBuf;
use codex_file_system::ExecutorFileSystem;
use codex_utils_absolute_path::AbsolutePathBuf;
use codex_utils_path_uri::PathUri;
use futures::future::join_all;
use schemars::JsonSchema;
use serde::Deserialize;
@@ -803,6 +804,7 @@ pub async fn resolve_root_git_project_for_trust(
) -> Option<AbsolutePathBuf> {
let repo_root = get_git_repo_root_with_fs(fs, cwd).await?;
let dot_git = repo_root.join(".git");
let dot_git_uri = PathUri::from_abs_path(&dot_git).ok()?;
if fs
.get_metadata(&dot_git, /*sandbox*/ None)
.await
@@ -812,7 +814,10 @@ pub async fn resolve_root_git_project_for_trust(
return Some(repo_root);
}
let git_dir_s = fs.read_file_text(&dot_git, /*sandbox*/ None).await.ok()?;
let git_dir_s = fs
.read_file_text(&dot_git_uri, /*sandbox*/ None)
.await
.ok()?;
let git_dir_rel = git_dir_s.trim().strip_prefix("gitdir:")?.trim();
if git_dir_rel.is_empty() {
return None;