(
state: State<'_, AppState>,
request: GitBranchesRequest,
)
| 684 | |
| 685 | #[tauri::command] |
| 686 | pub async fn git_get_branches( |
| 687 | state: State<'_, AppState>, |
| 688 | request: GitBranchesRequest, |
| 689 | ) -> Result<Vec<GitBranch>, String> { |
| 690 | let include_remote = request.include_remote.unwrap_or(false); |
| 691 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 692 | let mut args = vec![ |
| 693 | "for-each-ref".to_string(), |
| 694 | "--format=%(if)%(HEAD)%(then)*%(else) %(end)%09%(refname)%09%(refname:short)%09%(upstream:short)%09%(objectname)%09%(committerdate:iso-strict)".to_string(), |
| 695 | "refs/heads".to_string(), |
| 696 | ]; |
| 697 | if include_remote { |
| 698 | args.push("refs/remotes".to_string()); |
| 699 | } |
| 700 | let output = execute_remote_git_success(&state, &target, &args).await?; |
| 701 | return Ok(parse_remote_branches(&output)); |
| 702 | } |
| 703 | |
| 704 | GitService::get_branches(&request.repository_path, include_remote) |
| 705 | .await |
| 706 | .map_err(|e| { |
| 707 | error!( |
| 708 | "Failed to get Git branches: path={}, include_remote={}, error={}", |
| 709 | request.repository_path, include_remote, e |
| 710 | ); |
| 711 | format!("Failed to get Git branches: {}", e) |
| 712 | }) |
| 713 | } |
| 714 | |
| 715 | #[tauri::command] |
| 716 | pub async fn git_get_enhanced_branches( |
nothing calls this directly
no test coverage detected