(
state: State<'_, AppState>,
request: GitPushRequest,
)
| 832 | |
| 833 | #[tauri::command] |
| 834 | pub async fn git_push( |
| 835 | state: State<'_, AppState>, |
| 836 | request: GitPushRequest, |
| 837 | ) -> Result<GitOperationResult, String> { |
| 838 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 839 | let mut args = vec!["push".to_string()]; |
| 840 | if request.params.force.unwrap_or(false) { |
| 841 | args.push("--force".to_string()); |
| 842 | } |
| 843 | if request.params.set_upstream.unwrap_or(false) { |
| 844 | args.push("-u".to_string()); |
| 845 | } |
| 846 | if let Some(remote) = request.params.remote { |
| 847 | args.push(remote); |
| 848 | } |
| 849 | if let Some(branch) = request.params.branch { |
| 850 | args.push(branch); |
| 851 | } |
| 852 | return execute_remote_git_operation(&state, &target, &args).await; |
| 853 | } |
| 854 | |
| 855 | GitService::push(&request.repository_path, request.params) |
| 856 | .await |
| 857 | .map_err(|e| { |
| 858 | error!( |
| 859 | "Failed to push: path={}, error={}", |
| 860 | request.repository_path, e |
| 861 | ); |
| 862 | format!("Failed to push: {}", e) |
| 863 | }) |
| 864 | } |
| 865 | |
| 866 | #[tauri::command] |
| 867 | pub async fn git_pull( |
nothing calls this directly
no test coverage detected