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:172–182  ·  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

170/// carries is already there by definition. Importing it would duplicate
171/// them (the push → pull → import round trip).
172fn should_skip_self_push(parsed: &ParsedCommit, options: &ParallelImportOptions) -> bool {
173 if !options.incremental {
174 return false;
175 }
176 match &parsed.push_trailer {
177 Some(trailer) => {
178 self_push_state_known(trailer, &options.target_view, &options.known_states)
179 }
180 None => false,
181 }
182}
183
184/// The self-push rule in one place: a commit created by `atomic git push`
185/// 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