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

Source from the content-addressed store, hash-verified

1312 #[test]
1313 #[file_serial]
1314 fn test_diff_untracked_flag() {
1315 let _guard = DirGuard::new();
1316
1317 let temp_dir = tempfile::tempdir().unwrap();
1318 let repo_path = temp_dir.path();
1319
1320 // Initialize repository and create untracked file
1321 {
1322 let _repo = Repository::init(repo_path).unwrap();
1323 std::fs::write(repo_path.join("untracked.txt"), "Hello").unwrap();
1324 }
1325
1326 std::env::set_current_dir(repo_path).unwrap();
1327
1328 // Run diff with --untracked flag
1329 let diff = Diff {
1330 untracked: true,
1331 short: true,
1332 ..Default::default()
1333 };
1334 let result = diff.run();
1335
1336 // Should succeed and include untracked files
1337 assert!(result.is_ok());
1338 }
1339
1340 #[test]
1341 fn test_file_change_status_untracked() {

Callers

nothing calls this directly

Calls 5

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected