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

Function should_skip_self_push

atomic-cli/src/commands/git/parallel.rs:575–585  ·  view source on GitHub ↗

Whether to skip importing this commit because `atomic git push` created it and the target view already contains the state it represents. The trailer's `Atomic-State` is the Merkle of the view's change sequence at push time; if that state is in the view, every change the commit carries is already there by definition. Importing it would duplicate them (the push → pull → import round trip).

(parsed: &ParsedCommit, options: &ParallelImportOptions)

Source from the content-addressed store, hash-verified

573/// carries is already there by definition. Importing it would duplicate
574/// them (the push → pull → import round trip).
575fn should_skip_self_push(parsed: &ParsedCommit, options: &ParallelImportOptions) -> bool {
576 if !options.incremental {
577 return false;
578 }
579 match &parsed.push_trailer {
580 Some(trailer) => {
581 self_push_state_known(trailer, &options.target_view, &options.known_states)
582 }
583 None => false,
584 }
585}
586
587/// The self-push rule in one place: a commit created by `atomic git push`
588/// carries the target view's Merkle state, so if that view already has the

Callers 1

phase2_writeMethod · 0.85

Calls 1

self_push_state_knownFunction · 0.85

Tested by

no test coverage detected