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

Source from the content-addressed store, hash-verified

4321
4322 #[test]
4323 fn test_should_skip_self_push() {
4324 let (state_b32, state) = test_state();
4325 let mut options = ParallelImportOptions {
4326 incremental: true,
4327 target_view: "main".to_string(),
4328 ..ParallelImportOptions::default()
4329 };
4330 options.known_states.insert(state);
4331
4332 let parsed = self_push_commit("main", &state_b32);
4333 assert!(should_skip_self_push(&parsed, &options));
4334
4335 // Wrong view (e.g. commit pushed from `dev`, now imported on `main`)
4336 let mut options_dev = options.clone();
4337 options_dev.target_view = "dev".to_string();
4338 assert!(!should_skip_self_push(&parsed, &options_dev));
4339
4340 // Unknown state → must import (content may not be present locally)
4341 let mut options_empty = options.clone();
4342 options_empty.known_states = HashSet::new();
4343 assert!(!should_skip_self_push(&parsed, &options_empty));
4344
4345 // No trailer → never skipped
4346 let mut plain = self_push_commit("main", &state_b32);
4347 plain.push_trailer = None;
4348 assert!(!should_skip_self_push(&plain, &options));
4349
4350 // Full (non-incremental) imports never skip
4351 let mut options_full = options.clone();
4352 options_full.incremental = false;
4353 assert!(!should_skip_self_push(&parsed, &options_full));
4354 }
4355
4356 #[test]
4357 fn test_file_operation_equality() {

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