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

Source from the content-addressed store, hash-verified

1055 #[test]
1056 #[serial]
1057 fn test_diff_untracked_flag() {
1058 let _guard = DirGuard::new();
1059
1060 let temp_dir = tempfile::tempdir().unwrap();
1061 let repo_path = temp_dir.path();
1062
1063 // Initialize repository and create untracked file
1064 {
1065 let _repo = Repository::init(repo_path).unwrap();
1066 std::fs::write(repo_path.join("untracked.txt"), "Hello").unwrap();
1067 }
1068
1069 std::env::set_current_dir(repo_path).unwrap();
1070
1071 // Run diff with --untracked flag
1072 let diff = Diff {
1073 untracked: true,
1074 short: true,
1075 ..Default::default()
1076 };
1077 let result = diff.run();
1078
1079 // Should succeed and include untracked files
1080 assert!(result.is_ok());
1081 }
1082
1083 #[test]
1084 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