(root: &Path, scheduled: &ScheduledObservation)
| 1618 | } |
| 1619 | |
| 1620 | fn spawn_deferred_observer(root: &Path, scheduled: &ScheduledObservation) -> CliResult<()> { |
| 1621 | let binary = std::env::current_exe() |
| 1622 | .map_err(|error| git_error(format!("cannot resolve the Atomic binary path: {error}")))?; |
| 1623 | ProcessCommand::new(binary) |
| 1624 | .arg("git") |
| 1625 | .arg("shim") |
| 1626 | .arg("observe-deferred") |
| 1627 | .arg("--root") |
| 1628 | .arg(root) |
| 1629 | .arg("--request") |
| 1630 | .arg(&scheduled.request_path) |
| 1631 | .current_dir(root) |
| 1632 | .stdin(Stdio::null()) |
| 1633 | .stdout(Stdio::null()) |
| 1634 | .stderr(Stdio::null()) |
| 1635 | .spawn() |
| 1636 | .map_err(|error| { |
| 1637 | git_error(format!( |
| 1638 | "checkout event {} was journaled but its deferred observer could not be started: {error}", |
| 1639 | scheduled.event_id |
| 1640 | )) |
| 1641 | })?; |
| 1642 | Ok(()) |
| 1643 | } |
| 1644 | |
| 1645 | /// Execute one deferred request using the existing strictly read-only observer. |
| 1646 | pub(crate) fn run_deferred_observation(root: &Path, request_path: &Path) -> CliResult<()> { |
no test coverage detected