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

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 6

writeFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45
with_dry_runMethod · 0.45
with_filesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected