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

Function test_diff_untracked_flag

atomic-cli/src/commands/diff/tests.rs:1295–1319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1293 #[test]
1294 #[serial]
1295 fn test_diff_untracked_flag() {
1296 let _guard = DirGuard::new();
1297
1298 let temp_dir = tempfile::tempdir().unwrap();
1299 let repo_path = temp_dir.path();
1300
1301 // Initialize repository and create untracked file
1302 {
1303 let _repo = Repository::init(repo_path).unwrap();
1304 std::fs::write(repo_path.join("untracked.txt"), "Hello").unwrap();
1305 }
1306
1307 std::env::set_current_dir(repo_path).unwrap();
1308
1309 // Run diff with --untracked flag
1310 let diff = Diff {
1311 untracked: true,
1312 short: true,
1313 ..Default::default()
1314 };
1315 let result = diff.run();
1316
1317 // Should succeed and include untracked files
1318 assert!(result.is_ok());
1319 }
1320
1321 #[test]
1322 fn test_file_change_status_untracked() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected