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:10236–10267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10234
10235 #[test]
10236 fn test_should_skip_self_push() {
10237 let (state_b32, state) = test_state();
10238 let mut options = ParallelImportOptions {
10239 incremental: true,
10240 target_view: "main".to_string(),
10241 ..ParallelImportOptions::default()
10242 };
10243 options.known_states.insert(state);
10244
10245 let parsed = self_push_commit("main", &state_b32);
10246 assert!(should_skip_self_push(&parsed, &options));
10247
10248 // Wrong view (e.g. commit pushed from `dev`, now imported on `main`)
10249 let mut options_dev = options.clone();
10250 options_dev.target_view = "dev".to_string();
10251 assert!(!should_skip_self_push(&parsed, &options_dev));
10252
10253 // Unknown state → must import (content may not be present locally)
10254 let mut options_empty = options.clone();
10255 options_empty.known_states = HashSet::new();
10256 assert!(!should_skip_self_push(&parsed, &options_empty));
10257
10258 // No trailer → never skipped
10259 let mut plain = self_push_commit("main", &state_b32);
10260 plain.push_trailer = None;
10261 assert!(!should_skip_self_push(&plain, &options));
10262
10263 // Full (non-incremental) imports never skip
10264 let mut options_full = options.clone();
10265 options_full.incremental = false;
10266 assert!(!should_skip_self_push(&parsed, &options_full));
10267 }
10268
10269 #[test]
10270 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