(
state: State<'_, AppState>,
request: GitCheckoutBranchRequest,
)
| 895 | |
| 896 | #[tauri::command] |
| 897 | pub async fn git_checkout_branch( |
| 898 | state: State<'_, AppState>, |
| 899 | request: GitCheckoutBranchRequest, |
| 900 | ) -> Result<GitOperationResult, String> { |
| 901 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 902 | return execute_remote_git_operation( |
| 903 | &state, |
| 904 | &target, |
| 905 | &["checkout".to_string(), request.branch_name], |
| 906 | ) |
| 907 | .await; |
| 908 | } |
| 909 | |
| 910 | GitService::checkout_branch(&request.repository_path, &request.branch_name) |
| 911 | .await |
| 912 | .map_err(|e| { |
| 913 | error!( |
| 914 | "Failed to checkout branch: path={}, branch={}, error={}", |
| 915 | request.repository_path, request.branch_name, e |
| 916 | ); |
| 917 | format!("Failed to checkout branch: {}", e) |
| 918 | }) |
| 919 | } |
| 920 | |
| 921 | #[tauri::command] |
| 922 | pub async fn git_create_branch( |
nothing calls this directly
no test coverage detected