MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / spawn_deferred_observer

Function spawn_deferred_observer

atomic-cli/src/commands/git/hooks.rs:1620–1643  ·  view source on GitHub ↗
(root: &Path, scheduled: &ScheduledObservation)

Source from the content-addressed store, hash-verified

1618}
1619
1620fn 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.
1646pub(crate) fn run_deferred_observation(root: &Path, request_path: &Path) -> CliResult<()> {

Callers 1

record_post_checkoutFunction · 0.85

Calls 2

spawnMethod · 0.80
git_errorFunction · 0.70

Tested by

no test coverage detected