(
state: State<'_, AppState>,
request: GitResetFilesRequest,
)
| 1031 | |
| 1032 | #[tauri::command] |
| 1033 | pub async fn git_reset_files( |
| 1034 | state: State<'_, AppState>, |
| 1035 | request: GitResetFilesRequest, |
| 1036 | ) -> Result<GitOperationResult, String> { |
| 1037 | let staged = request.staged.unwrap_or(false); |
| 1038 | |
| 1039 | info!( |
| 1040 | "Resetting files in '{}' (staged: {}): {:?}", |
| 1041 | request.repository_path, staged, request.files |
| 1042 | ); |
| 1043 | |
| 1044 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 1045 | let mut args = vec!["restore".to_string()]; |
| 1046 | if staged { |
| 1047 | args.push("--staged".to_string()); |
| 1048 | } |
| 1049 | args.extend(request.files); |
| 1050 | return execute_remote_git_operation(&state, &target, &args).await; |
| 1051 | } |
| 1052 | |
| 1053 | GitService::reset_files(&request.repository_path, &request.files, staged) |
| 1054 | .await |
| 1055 | .map(|output| GitOperationResult { |
| 1056 | success: true, |
| 1057 | data: None, |
| 1058 | error: None, |
| 1059 | output: Some(output), |
| 1060 | duration: None, |
| 1061 | }) |
| 1062 | .map_err(|e| e.to_string()) |
| 1063 | } |
| 1064 | |
| 1065 | #[tauri::command] |
| 1066 | pub async fn git_get_file_content( |
nothing calls this directly
no test coverage detected