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

Function test_add_verify_tracking_after_add

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

Source from the content-addressed store, hash-verified

1357 #[test]
1358 #[file_serial]
1359 fn test_add_verify_tracking_after_add() {
1360 let _guard = DirGuard::new();
1361
1362 let temp_dir = tempfile::tempdir().unwrap();
1363 let repo_path = temp_dir.path();
1364
1365 // Initialize repository
1366 {
1367 let _repo = Repository::init(repo_path).unwrap();
1368 }
1369
1370 // Create a file
1371 std::fs::write(repo_path.join("tracked.txt"), "content").unwrap();
1372
1373 std::env::set_current_dir(repo_path).unwrap();
1374
1375 // Add the file
1376 let add = Add::new().with_files(vec!["tracked.txt"]);
1377 add.run().unwrap();
1378
1379 // Verify it's tracked
1380 {
1381 let repo = Repository::open(repo_path).unwrap();
1382 assert!(repo.is_tracked("tracked.txt").unwrap());
1383 }
1384 }
1385
1386 #[test]
1387 #[file_serial]

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected