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

Function test_add_dry_run_does_not_track

atomic-cli/src/commands/add.rs:1388–1415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1386 #[test]
1387 #[file_serial]
1388 fn test_add_dry_run_does_not_track() {
1389 let _guard = DirGuard::new();
1390
1391 let temp_dir = tempfile::tempdir().unwrap();
1392 let repo_path = temp_dir.path();
1393
1394 // Initialize repository
1395 {
1396 let _repo = Repository::init(repo_path).unwrap();
1397 }
1398
1399 // Create a file
1400 std::fs::write(repo_path.join("not_tracked.txt"), "content").unwrap();
1401
1402 std::env::set_current_dir(repo_path).unwrap();
1403
1404 // Dry run add
1405 let add = Add::new()
1406 .with_files(vec!["not_tracked.txt"])
1407 .with_dry_run(true);
1408 add.run().unwrap();
1409
1410 // Verify it's NOT tracked
1411 {
1412 let repo = Repository::open(repo_path).unwrap();
1413 assert!(!repo.is_tracked("not_tracked.txt").unwrap());
1414 }
1415 }
1416}

Callers

nothing calls this directly

Calls 8

openFunction · 0.85
initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
with_dry_runMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected