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

Source from the content-addressed store, hash-verified

1207 #[test]
1208 #[serial]
1209 fn test_add_verify_tracking_after_add() {
1210 let _guard = DirGuard::new();
1211
1212 let temp_dir = tempfile::tempdir().unwrap();
1213 let repo_path = temp_dir.path();
1214
1215 // Initialize repository
1216 {
1217 let _repo = Repository::init(repo_path).unwrap();
1218 }
1219
1220 // Create a file
1221 std::fs::write(repo_path.join("tracked.txt"), "content").unwrap();
1222
1223 std::env::set_current_dir(repo_path).unwrap();
1224
1225 // Add the file
1226 let add = Add::new().with_files(vec!["tracked.txt"]);
1227 add.run().unwrap();
1228
1229 // Verify it's tracked
1230 {
1231 let repo = Repository::open(repo_path).unwrap();
1232 assert!(repo.is_tracked("tracked.txt").unwrap());
1233 }
1234 }
1235
1236 #[test]
1237 #[serial]

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected