mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
Merge commit 'f047aa7f31837b0ea65ec1ea914d32d2162b6796' into codex/psec-4394-git-06-merge-guard
This commit is contained in:
@@ -641,6 +641,22 @@ mod tests {
|
||||
#[test]
|
||||
fn apply_then_revert_success() {
|
||||
let _g = env_lock().lock().unwrap();
|
||||
if std::env::var_os("CODEX_GIT_UTILS_APPLY_ENV_CHILD").is_none() {
|
||||
let config_dir = tempfile::tempdir().expect("config tempdir");
|
||||
let global_config = config_dir.path().join("global.gitconfig");
|
||||
let system_config = config_dir.path().join("system.gitconfig");
|
||||
std::fs::write(&global_config, "").expect("empty global config");
|
||||
std::fs::write(&system_config, "").expect("empty system config");
|
||||
run_isolated_test(
|
||||
"apply::tests::apply_then_revert_success",
|
||||
&[
|
||||
("GIT_CONFIG_GLOBAL", global_config.as_os_str()),
|
||||
("GIT_CONFIG_SYSTEM", system_config.as_os_str()),
|
||||
],
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let repo = init_repo();
|
||||
let root = repo.path();
|
||||
// Seed file and commit original content
|
||||
|
||||
@@ -714,6 +714,22 @@ fn stage_effective_paths(
|
||||
|
||||
#[test]
|
||||
fn standalone_stage_paths_uses_one_source_authorization_and_one_filter_read() {
|
||||
if std::env::var_os("CODEX_GIT_UTILS_PATH_ENV_CHILD").is_none() {
|
||||
let config_dir = tempfile::tempdir().expect("config tempdir");
|
||||
let global_config = config_dir.path().join("global.gitconfig");
|
||||
let system_config = config_dir.path().join("system.gitconfig");
|
||||
std::fs::write(&global_config, "").expect("empty global config");
|
||||
std::fs::write(&system_config, "").expect("empty system config");
|
||||
run_isolated_test(
|
||||
"patch_paths::tests::standalone_stage_paths_uses_one_source_authorization_and_one_filter_read",
|
||||
&[
|
||||
("GIT_CONFIG_GLOBAL", global_config.as_os_str()),
|
||||
("GIT_CONFIG_SYSTEM", system_config.as_os_str()),
|
||||
],
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let repo = init_repo();
|
||||
let root = repo.path();
|
||||
std::fs::write(root.join("single.txt"), "single\n").expect("write staged file");
|
||||
@@ -729,6 +745,22 @@ fn standalone_stage_paths_uses_one_source_authorization_and_one_filter_read() {
|
||||
|
||||
#[test]
|
||||
fn composed_staging_freshly_observes_a_new_clean_driver_and_attribute() {
|
||||
if std::env::var_os("CODEX_GIT_UTILS_PATH_ENV_CHILD").is_none() {
|
||||
let config_dir = tempfile::tempdir().expect("config tempdir");
|
||||
let global_config = config_dir.path().join("global.gitconfig");
|
||||
let system_config = config_dir.path().join("system.gitconfig");
|
||||
std::fs::write(&global_config, "").expect("empty global config");
|
||||
std::fs::write(&system_config, "").expect("empty system config");
|
||||
run_isolated_test(
|
||||
"patch_paths::tests::composed_staging_freshly_observes_a_new_clean_driver_and_attribute",
|
||||
&[
|
||||
("GIT_CONFIG_GLOBAL", global_config.as_os_str()),
|
||||
("GIT_CONFIG_SYSTEM", system_config.as_os_str()),
|
||||
],
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
let repo = init_repo();
|
||||
let root = repo.path();
|
||||
std::fs::write(root.join("file.txt"), "base\n").expect("write base file");
|
||||
|
||||
Reference in New Issue
Block a user