(
state: State<'_, AppState>,
request: GitAddFilesRequest,
)
| 766 | |
| 767 | #[tauri::command] |
| 768 | pub async fn git_add_files( |
| 769 | state: State<'_, AppState>, |
| 770 | request: GitAddFilesRequest, |
| 771 | ) -> Result<GitOperationResult, String> { |
| 772 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 773 | let mut args = vec!["add".to_string()]; |
| 774 | if request.params.all.unwrap_or(false) { |
| 775 | args.push("-A".to_string()); |
| 776 | } else if request.params.update.unwrap_or(false) { |
| 777 | args.push("-u".to_string()); |
| 778 | } else { |
| 779 | args.extend(request.params.files); |
| 780 | } |
| 781 | return execute_remote_git_operation(&state, &target, &args).await; |
| 782 | } |
| 783 | |
| 784 | GitService::add_files(&request.repository_path, request.params) |
| 785 | .await |
| 786 | .map_err(|e| { |
| 787 | error!( |
| 788 | "Failed to add files: path={}, error={}", |
| 789 | request.repository_path, e |
| 790 | ); |
| 791 | format!("Failed to add files: {}", e) |
| 792 | }) |
| 793 | } |
| 794 | |
| 795 | #[tauri::command] |
| 796 | pub async fn git_commit( |
nothing calls this directly
no test coverage detected