Fix Formatting

Fix
This commit is contained in:
rreichel3-oai
2025-12-22 11:20:20 -05:00
committed by GitHub
parent 9fdd2e00f1
commit 91d03f29d1

View File

@@ -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 <cmd> simply do the check for <cmd>
Some("sudo") => is_dangerous_to_call_with_exec(&command[1..]),