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

Source from the content-addressed store, hash-verified

4291
4292 #[test]
4293 fn test_should_skip_self_push() {
4294 let (state_b32, state) = test_state();
4295 let mut options = ParallelImportOptions {
4296 incremental: true,
4297 target_view: "main".to_string(),
4298 ..ParallelImportOptions::default()
4299 };
4300 options.known_states.insert(state);
4301
4302 let parsed = self_push_commit("main", &state_b32);
4303 assert!(should_skip_self_push(&parsed, &options));
4304
4305 // Wrong view (e.g. commit pushed from `dev`, now imported on `main`)
4306 let mut options_dev = options.clone();
4307 options_dev.target_view = "dev".to_string();
4308 assert!(!should_skip_self_push(&parsed, &options_dev));
4309
4310 // Unknown state → must import (content may not be present locally)
4311 let mut options_empty = options.clone();
4312 options_empty.known_states = HashSet::new();
4313 assert!(!should_skip_self_push(&parsed, &options_empty));
4314
4315 // No trailer → never skipped
4316 let mut plain = self_push_commit("main", &state_b32);
4317 plain.push_trailer = None;
4318 assert!(!should_skip_self_push(&plain, &options));
4319
4320 // Full (non-incremental) imports never skip
4321 let mut options_full = options.clone();
4322 options_full.incremental = false;
4323 assert!(!should_skip_self_push(&parsed, &options_full));
4324 }
4325
4326 #[test]
4327 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