()
| 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 | } |
nothing calls this directly
no test coverage detected