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:189–195  ·  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

187/// [`incremental_import_skips`] so the real import and the `--dry-run` forecast
188/// can never disagree on it.
189fn self_push_state_known(
190 trailer: &PushTrailer,
191 target_view: &str,
192 known_states: &HashSet<Merkle>,
193) -> bool {
194 trailer.view == target_view && known_states.contains(&trailer.state)
195}
196
197/// Whether an incremental import would skip the git commit identified by `sha`
198/// with the given commit `message`, for a target view that already contains

Callers 2

should_skip_self_pushFunction · 0.85
incremental_import_skipsFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected