mirror of
https://github.com/openai/codex.git
synced 2026-11-08 00:36:31 +00:00
Move git utilities into a dedicated crate (#15564)
- create `codex-git-utils` and move the shared git helpers into it with file moves preserved for diff readability - move the `GitInfo` helpers out of `core` so stacked rollout work can depend on the shared crate without carrying its own git info module --------- Co-authored-by: Ahmed Ibrahim <219906144+aibrahim-oai@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
68 files changed
+206
-134
No files matched your search
@@ -16,6 +16,8 @@ use chrono::Utc;
|
||||
|
||||
use codex_backend_client as backend;
|
||||
use codex_backend_client::CodeTaskDetailsResponseExt;
|
||||
use codex_git_utils::ApplyGitRequest;
|
||||
use codex_git_utils::apply_git_patch;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct HttpClient {
|
||||
@@ -459,13 +461,13 @@ mod api {
|
||||
});
|
||||
}
|
||||
|
||||
let req = codex_git::ApplyGitRequest {
|
||||
let req = ApplyGitRequest {
|
||||
cwd: std::env::current_dir().unwrap_or_else(|_| std::env::temp_dir()),
|
||||
diff: diff.clone(),
|
||||
revert: false,
|
||||
preflight,
|
||||
};
|
||||
let r = codex_git::apply_git_patch(&req)
|
||||
let r = apply_git_patch(&req)
|
||||
.map_err(|e| CloudTaskError::Io(format!("git apply failed to run: {e}")))?;
|
||||
|
||||
let status = if r.exit_code == 0 {
|
||||
|
||||
Reference in new issue
Block a user