(root: &Path, ref_name: &str)
| 546 | } |
| 547 | |
| 548 | fn resolve_ref(root: &Path, ref_name: &str) -> Result<Option<String>, WipCaptureError> { |
| 549 | let args = vec![ |
| 550 | OsString::from("rev-parse"), |
| 551 | OsString::from("--verify"), |
| 552 | OsString::from("--quiet"), |
| 553 | OsString::from(ref_name), |
| 554 | ]; |
| 555 | let output = run_git_raw(root, "resolve WIP recovery ref", &args, None, None)?; |
| 556 | if output.status.success() { |
| 557 | return output_text("resolve WIP recovery ref", output.stdout).map(Some); |
| 558 | } |
| 559 | if output.status.code() == Some(1) && output.stderr.is_empty() { |
| 560 | return Ok(None); |
| 561 | } |
| 562 | Err(command_failure("resolve WIP recovery ref", &output)) |
| 563 | } |
| 564 | |
| 565 | fn split_nul(bytes: Vec<u8>) -> Vec<Vec<u8>> { |
| 566 | bytes |
no test coverage detected