diff --git a/codex-rs/core/src/command_safety/is_dangerous_command.rs b/codex-rs/core/src/command_safety/is_dangerous_command.rs index fe4d88f40d..0bf91578f7 100644 --- a/codex-rs/core/src/command_safety/is_dangerous_command.rs +++ b/codex-rs/core/src/command_safety/is_dangerous_command.rs @@ -67,10 +67,16 @@ fn is_dangerous_to_call_with_exec(command: &[String]) -> bool { match cmd0 { Some(cmd) if cmd.ends_with("git") || cmd.ends_with("/git") => { - matches!(command.get(1).map(String::as_str), Some("reset" | "rm" | "--force" )) + matches!( + command.get(1).map(String::as_str), + Some("reset" | "rm" | "--force" ) + ) } - Some("rm") => matches!(command.get(1).map(String::as_str), Some("-f" | "-rf" | "-Rf" | "-fr" | "-fR" | "--force" )), + Some("rm") => matches!( + command.get(1).map(String::as_str), + Some("-f" | "-rf" | "-Rf" | "-fr" | "-fR" | "--force" ) + ), // for sudo simply do the check for Some("sudo") => is_dangerous_to_call_with_exec(&command[1..]),