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

Function incremental_import_skips

atomic-cli/src/commands/git/parallel.rs:609–623  ·  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

607/// the single source of truth used by `atomic git import --dry-run` to forecast
608/// the real import count. Callers must only invoke it for incremental imports.
609pub(crate) fn incremental_import_skips(
610 sha: &str,
611 message: &str,
612 imported_shas: &HashSet<String>,
613 target_view: &str,
614 known_states: &HashSet<Merkle>,
615) -> bool {
616 if imported_shas.contains(sha) {
617 return true;
618 }
619 match parse_push_trailer(message) {
620 Some(trailer) => self_push_state_known(&trailer, target_view, known_states),
621 None => false,
622 }
623}
624
625/// Metadata extracted from a git commit.
626#[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