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

Function incremental_import_skips

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

Whether an incremental import would skip the git commit identified by `sha` with the given commit `message`, for a target view that already contains `imported_shas` and `known_states`. This mirrors exactly what the real importer does — the SHA skip in `collect_commit_oids` (already-imported commits) plus the self-push skip in `phase2_write` (commits whose carried view state is already present). I

(
    sha: &str,
    message: &str,
    imported_shas: &HashSet<String>,
    target_view: &str,
    known_states: &HashSet<Merkle>,
)

Source from the content-addressed store, hash-verified

204/// the single source of truth used by `atomic git import --dry-run` to forecast
205/// the real import count. Callers must only invoke it for incremental imports.
206pub(crate) fn incremental_import_skips(
207 sha: &str,
208 message: &str,
209 imported_shas: &HashSet<String>,
210 target_view: &str,
211 known_states: &HashSet<Merkle>,
212) -> bool {
213 if imported_shas.contains(sha) {
214 return true;
215 }
216 match parse_push_trailer(message) {
217 Some(trailer) => self_push_state_known(&trailer, target_view, known_states),
218 None => false,
219 }
220}
221
222/// Metadata extracted from a git commit.
223#[derive(Debug, Clone)]

Callers 2

count_commitsMethod · 0.85

Calls 3

parse_push_trailerFunction · 0.85
self_push_state_knownFunction · 0.85
containsMethod · 0.45

Tested by

no test coverage detected