MCPcopy Create free account
hub / github.com/GCWing/BitFun / git_get_enhanced_branches

Function git_get_enhanced_branches

src/apps/desktop/src/api/git_api.rs:716–743  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    request: GitBranchesRequest,
)

Source from the content-addressed store, hash-verified

714
715#[tauri::command]
716pub 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]
746pub async fn git_get_commits(

Callers

nothing calls this directly

Calls 4

parse_remote_branchesFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected