(
root: &Path,
tree_oid: &str,
parent_oid: Option<&str>,
)
| 476 | } |
| 477 | |
| 478 | fn create_recovery_commit( |
| 479 | root: &Path, |
| 480 | tree_oid: &str, |
| 481 | parent_oid: Option<&str>, |
| 482 | ) -> Result<String, WipCaptureError> { |
| 483 | let mut args = vec![OsString::from("commit-tree"), OsString::from(tree_oid)]; |
| 484 | if let Some(parent_oid) = parent_oid { |
| 485 | args.push(OsString::from("-p")); |
| 486 | args.push(OsString::from(parent_oid)); |
| 487 | } |
| 488 | |
| 489 | let mut command = git_command(root, &args, None); |
| 490 | command |
| 491 | .env("GIT_AUTHOR_NAME", "Atomic Recovery") |
| 492 | .env("GIT_AUTHOR_EMAIL", "recovery@atomic.invalid") |
| 493 | .env("GIT_COMMITTER_NAME", "Atomic Recovery") |
| 494 | .env("GIT_COMMITTER_EMAIL", "recovery@atomic.invalid"); |
| 495 | let output = execute_raw( |
| 496 | command, |
| 497 | "create neutral WIP commit", |
| 498 | Some(RECOVERY_COMMIT_MESSAGE.as_bytes()), |
| 499 | )?; |
| 500 | if !output.status.success() { |
| 501 | return Err(command_failure("create neutral WIP commit", &output)); |
| 502 | } |
| 503 | output_text("create neutral WIP commit", output.stdout) |
| 504 | } |
| 505 | |
| 506 | fn create_recovery_ref( |
| 507 | root: &Path, |
no test coverage detected