Move git info tests back to core

Remove the git-utils dev-dependency cycle by letting codex-core own the git-info tests again while the shared crate keeps the runtime implementation.\n\nCo-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-03-24 02:12:53 +00:00
parent b04875f40b
commit a375b3fe3b
5 changed files with 9 additions and 10 deletions

2
codex-rs/Cargo.lock generated
View File

@@ -2140,14 +2140,12 @@ name = "codex-git-utils"
version = "0.0.0"
dependencies = [
"assert_matches",
"core_test_support",
"futures",
"once_cell",
"pretty_assertions",
"regex",
"schemars 0.8.22",
"serde",
"serde_json",
"tempfile",
"thiserror 2.0.18",
"tokio",

View File

@@ -1,9 +1,14 @@
use super::*;
use codex_git_utils::GitInfo;
use codex_git_utils::collect_git_info;
use codex_git_utils::get_has_changes;
use codex_git_utils::git_diff_to_remote;
use codex_git_utils::recent_commits;
use codex_git_utils::resolve_root_git_project_for_trust;
use core_test_support::skip_if_sandbox;
use std::fs;
use std::path::PathBuf;
use tempfile::TempDir;
use tokio::process::Command;
// Helper function to create a test git repository
async fn create_test_git_repo(temp_dir: &TempDir) -> PathBuf {

View File

@@ -41,6 +41,8 @@ mod exec_policy;
pub mod external_agent_config;
mod file_watcher;
mod flags;
#[cfg(test)]
mod git_info_tests;
mod guardian;
mod hook_runtime;
pub mod instructions;

View File

@@ -26,6 +26,4 @@ walkdir = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
core_test_support = { workspace = true }
pretty_assertions = { workspace = true }
serde_json = { workspace = true }

View File

@@ -707,7 +707,3 @@ pub async fn current_branch_name(cwd: &Path) -> Option<String> {
.map(|s| s.trim().to_string())
.filter(|name| !name.is_empty())
}
#[cfg(test)]
#[path = "info_tests.rs"]
mod tests;