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:166–176  ·  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

164/// carries is already there by definition. Importing it would duplicate
165/// them (the push → pull → import round trip).
166fn should_skip_self_push(parsed: &ParsedCommit, options: &ParallelImportOptions) -> bool {
167 if !options.incremental {
168 return false;
169 }
170 match &parsed.push_trailer {
171 Some(trailer) => {
172 trailer.view == options.target_view && options.known_states.contains(&trailer.state)
173 }
174 None => false,
175 }
176}
177
178/// Metadata extracted from a git commit.
179#[derive(Debug, Clone)]

Callers 1

phase2_writeMethod · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected