()
| 1236 | #[test] |
| 1237 | #[serial] |
| 1238 | fn test_add_dry_run_does_not_track() { |
| 1239 | let _guard = DirGuard::new(); |
| 1240 | |
| 1241 | let temp_dir = tempfile::tempdir().unwrap(); |
| 1242 | let repo_path = temp_dir.path(); |
| 1243 | |
| 1244 | // Initialize repository |
| 1245 | { |
| 1246 | let _repo = Repository::init(repo_path).unwrap(); |
| 1247 | } |
| 1248 | |
| 1249 | // Create a file |
| 1250 | std::fs::write(repo_path.join("not_tracked.txt"), "content").unwrap(); |
| 1251 | |
| 1252 | std::env::set_current_dir(repo_path).unwrap(); |
| 1253 | |
| 1254 | // Dry run add |
| 1255 | let add = Add::new() |
| 1256 | .with_files(vec!["not_tracked.txt"]) |
| 1257 | .with_dry_run(true); |
| 1258 | add.run().unwrap(); |
| 1259 | |
| 1260 | // Verify it's NOT tracked |
| 1261 | { |
| 1262 | let repo = Repository::open(repo_path).unwrap(); |
| 1263 | assert!(!repo.is_tracked("not_tracked.txt").unwrap()); |
| 1264 | } |
| 1265 | } |
| 1266 | } |
nothing calls this directly
no test coverage detected