(
state: State<'_, AppState>,
request: GitBranchesRequest,
)
| 714 | |
| 715 | #[tauri::command] |
| 716 | pub async fn git_get_enhanced_branches( |
| 717 | state: State<'_, AppState>, |
| 718 | request: GitBranchesRequest, |
| 719 | ) -> Result<Vec<GitBranch>, String> { |
| 720 | let include_remote = request.include_remote.unwrap_or(false); |
| 721 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 722 | let mut args = vec![ |
| 723 | "for-each-ref".to_string(), |
| 724 | "--format=%(if)%(HEAD)%(then)*%(else) %(end)%09%(refname)%09%(refname:short)%09%(upstream:short)%09%(objectname)%09%(committerdate:iso-strict)".to_string(), |
| 725 | "refs/heads".to_string(), |
| 726 | ]; |
| 727 | if include_remote { |
| 728 | args.push("refs/remotes".to_string()); |
| 729 | } |
| 730 | let output = execute_remote_git_success(&state, &target, &args).await?; |
| 731 | return Ok(parse_remote_branches(&output)); |
| 732 | } |
| 733 | |
| 734 | GitService::get_enhanced_branches(&request.repository_path, include_remote) |
| 735 | .await |
| 736 | .map_err(|e| { |
| 737 | error!( |
| 738 | "Failed to get enhanced Git branches: path={}, include_remote={}, error={}", |
| 739 | request.repository_path, include_remote, e |
| 740 | ); |
| 741 | format!("Failed to get enhanced Git branches: {}", e) |
| 742 | }) |
| 743 | } |
| 744 | |
| 745 | #[tauri::command] |
| 746 | pub async fn git_get_commits( |
nothing calls this directly
no test coverage detected