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

Function self_push_state_known

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

The self-push rule in one place: a commit created by `atomic git push` carries the target view's Merkle state, so if that view already has the state, the commit adds nothing. Shared by [`should_skip_self_push`] and [`incremental_import_skips`] so the real import and the `--dry-run` forecast can never disagree on it.

(
    trailer: &PushTrailer,
    target_view: &str,
    known_states: &HashSet<Merkle>,
)

Source from the content-addressed store, hash-verified

590/// [`incremental_import_skips`] so the real import and the `--dry-run` forecast
591/// can never disagree on it.
592fn self_push_state_known(
593 trailer: &PushTrailer,
594 target_view: &str,
595 known_states: &HashSet<Merkle>,
596) -> bool {
597 trailer.view == target_view && known_states.contains(&trailer.state)
598}
599
600/// Whether an incremental import would skip the git commit identified by `sha`
601/// with the given commit `message`, for a target view that already contains

Callers 3

should_skip_self_pushFunction · 0.85
incremental_import_skipsFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected