(root: &Path, scheduled: &ScheduledObservation)
| 1649 | } |
| 1650 | |
| 1651 | fn spawn_deferred_observer(root: &Path, scheduled: &ScheduledObservation) -> CliResult<()> { |
| 1652 | let binary = std::env::current_exe() |
| 1653 | .map_err(|error| git_error(format!("cannot resolve the Atomic binary path: {error}")))?; |
| 1654 | ProcessCommand::new(binary) |
| 1655 | .arg("git") |
| 1656 | .arg("shim") |
| 1657 | .arg("observe-deferred") |
| 1658 | .arg("--root") |
| 1659 | .arg(root) |
| 1660 | .arg("--request") |
| 1661 | .arg(&scheduled.request_path) |
| 1662 | .current_dir(root) |
| 1663 | .stdin(Stdio::null()) |
| 1664 | .stdout(Stdio::null()) |
| 1665 | .stderr(Stdio::null()) |
| 1666 | .spawn() |
| 1667 | .map_err(|error| { |
| 1668 | git_error(format!( |
| 1669 | "checkout event {} was journaled but its deferred observer could not be started: {error}", |
| 1670 | scheduled.event_id |
| 1671 | )) |
| 1672 | })?; |
| 1673 | Ok(()) |
| 1674 | } |
| 1675 | |
| 1676 | /// Execute one deferred request using the existing strictly read-only observer. |
| 1677 | pub(crate) fn run_deferred_observation(root: &Path, request_path: &Path) -> CliResult<()> { |
no test coverage detected