(
state: State<'_, AppState>,
request: GitPullRequest,
)
| 865 | |
| 866 | #[tauri::command] |
| 867 | pub async fn git_pull( |
| 868 | state: State<'_, AppState>, |
| 869 | request: GitPullRequest, |
| 870 | ) -> Result<GitOperationResult, String> { |
| 871 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 872 | let mut args = vec!["pull".to_string()]; |
| 873 | if request.params.rebase.unwrap_or(false) { |
| 874 | args.push("--rebase".to_string()); |
| 875 | } |
| 876 | if let Some(remote) = request.params.remote { |
| 877 | args.push(remote); |
| 878 | } |
| 879 | if let Some(branch) = request.params.branch { |
| 880 | args.push(branch); |
| 881 | } |
| 882 | return execute_remote_git_operation(&state, &target, &args).await; |
| 883 | } |
| 884 | |
| 885 | GitService::pull(&request.repository_path, request.params) |
| 886 | .await |
| 887 | .map_err(|e| { |
| 888 | error!( |
| 889 | "Failed to pull: path={}, error={}", |
| 890 | request.repository_path, e |
| 891 | ); |
| 892 | format!("Failed to pull: {}", e) |
| 893 | }) |
| 894 | } |
| 895 | |
| 896 | #[tauri::command] |
| 897 | pub async fn git_checkout_branch( |
nothing calls this directly
no test coverage detected