(mut args: serde_json::Value)
| 6275 | } |
| 6276 | |
| 6277 | fn normalize_git_args(mut args: serde_json::Value) -> PyResult<serde_json::Value> { |
| 6278 | let obj = args |
| 6279 | .as_object_mut() |
| 6280 | .ok_or_else(|| PyValueError::new_err("git options must be a dict"))?; |
| 6281 | |
| 6282 | if !obj.contains_key("command") { |
| 6283 | return Err(PyValueError::new_err( |
| 6284 | "git options must include a command field", |
| 6285 | )); |
| 6286 | } |
| 6287 | |
| 6288 | for (from, to) in [ |
| 6289 | ("newBranch", "new_branch"), |
| 6290 | ("maxCount", "max_count"), |
| 6291 | ("includeUntracked", "include_untracked"), |
| 6292 | ] { |
| 6293 | if let Some(value) = obj.remove(from) { |
| 6294 | obj.entry(to.to_string()).or_insert(value); |
| 6295 | } |
| 6296 | } |
| 6297 | |
| 6298 | if let Some(value) = obj.remove("reference") { |
| 6299 | obj.entry("ref".to_string()).or_insert(value); |
| 6300 | } |
| 6301 | |
| 6302 | Ok(args) |
| 6303 | } |
| 6304 | |
| 6305 | fn normalize_program_script_options( |
| 6306 | options: &Bound<'_, pyo3::types::PyDict>, |
no test coverage detected