(
state: State<'_, AppState>,
request: GitCreateBranchRequest,
)
| 920 | |
| 921 | #[tauri::command] |
| 922 | pub async fn git_create_branch( |
| 923 | state: State<'_, AppState>, |
| 924 | request: GitCreateBranchRequest, |
| 925 | ) -> Result<GitOperationResult, String> { |
| 926 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 927 | let mut args = vec![ |
| 928 | "checkout".to_string(), |
| 929 | "-b".to_string(), |
| 930 | request.branch_name, |
| 931 | ]; |
| 932 | if let Some(start_point) = request.start_point.filter(|s| !s.trim().is_empty()) { |
| 933 | args.push(start_point); |
| 934 | } |
| 935 | return execute_remote_git_operation(&state, &target, &args).await; |
| 936 | } |
| 937 | |
| 938 | GitService::create_branch( |
| 939 | &request.repository_path, |
| 940 | &request.branch_name, |
| 941 | request.start_point.as_deref(), |
| 942 | ) |
| 943 | .await |
| 944 | .map_err(|e| { |
| 945 | error!( |
| 946 | "Failed to create branch: path={}, branch={}, error={}", |
| 947 | request.repository_path, request.branch_name, e |
| 948 | ); |
| 949 | format!("Failed to create branch: {}", e) |
| 950 | }) |
| 951 | } |
| 952 | |
| 953 | #[tauri::command] |
| 954 | pub async fn git_delete_branch( |
nothing calls this directly
no test coverage detected