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

Function test_should_skip_self_push

atomic-cli/src/commands/git/parallel.rs:4692–4723  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4690
4691 #[test]
4692 fn test_should_skip_self_push() {
4693 let (state_b32, state) = test_state();
4694 let mut options = ParallelImportOptions {
4695 incremental: true,
4696 target_view: "main".to_string(),
4697 ..ParallelImportOptions::default()
4698 };
4699 options.known_states.insert(state);
4700
4701 let parsed = self_push_commit("main", &state_b32);
4702 assert!(should_skip_self_push(&parsed, &options));
4703
4704 // Wrong view (e.g. commit pushed from `dev`, now imported on `main`)
4705 let mut options_dev = options.clone();
4706 options_dev.target_view = "dev".to_string();
4707 assert!(!should_skip_self_push(&parsed, &options_dev));
4708
4709 // Unknown state → must import (content may not be present locally)
4710 let mut options_empty = options.clone();
4711 options_empty.known_states = HashSet::new();
4712 assert!(!should_skip_self_push(&parsed, &options_empty));
4713
4714 // No trailer → never skipped
4715 let mut plain = self_push_commit("main", &state_b32);
4716 plain.push_trailer = None;
4717 assert!(!should_skip_self_push(&plain, &options));
4718
4719 // Full (non-incremental) imports never skip
4720 let mut options_full = options.clone();
4721 options_full.incremental = false;
4722 assert!(!should_skip_self_push(&parsed, &options_full));
4723 }
4724
4725 #[test]
4726 fn test_incremental_import_skips() {

Callers

nothing calls this directly

Calls 4

test_stateFunction · 0.85
self_push_commitFunction · 0.85
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected