()
| 1058 | #[test] |
| 1059 | #[file_serial] |
| 1060 | fn test_add_run_already_tracked() { |
| 1061 | let _guard = DirGuard::new(); |
| 1062 | |
| 1063 | let temp_dir = tempfile::tempdir().unwrap(); |
| 1064 | let repo_path = temp_dir.path(); |
| 1065 | |
| 1066 | // Initialize repository |
| 1067 | { |
| 1068 | let repo = Repository::init(repo_path).unwrap(); |
| 1069 | |
| 1070 | // Create and add a file |
| 1071 | std::fs::write(repo_path.join("test.txt"), "Hello").unwrap(); |
| 1072 | let working_copy = repo.require_working_copy_id().unwrap(); |
| 1073 | repo.add(working_copy, "test.txt", TrackingOptions::default()) |
| 1074 | .unwrap(); |
| 1075 | } |
| 1076 | |
| 1077 | std::env::set_current_dir(repo_path).unwrap(); |
| 1078 | |
| 1079 | // Try to add again |
| 1080 | let add = Add::new().with_files(vec!["test.txt"]); |
| 1081 | let result = add.run(); |
| 1082 | |
| 1083 | // Should succeed (skips already tracked files) |
| 1084 | assert!(result.is_ok(), "Add failed: {:?}", result.err()); |
| 1085 | } |
| 1086 | |
| 1087 | #[test] |
| 1088 | #[file_serial] |
nothing calls this directly
no test coverage detected