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

Function git_delete_branch

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

Source from the content-addressed store, hash-verified

952
953#[tauri::command]
954pub async fn git_delete_branch(
955 state: State<'_, AppState>,
956 request: GitDeleteBranchRequest,
957) -> Result<GitOperationResult, String> {
958 let force = request.force.unwrap_or(false);
959 if let Some(target) = resolve_remote_git_target(&request.repository_path).await {
960 return execute_remote_git_operation(
961 &state,
962 &target,
963 &[
964 "branch".to_string(),
965 if force { "-D" } else { "-d" }.to_string(),
966 request.branch_name,
967 ],
968 )
969 .await;
970 }
971
972 GitService::delete_branch(&request.repository_path, &request.branch_name, force)
973 .await
974 .map_err(|e| {
975 error!(
976 "Failed to delete branch: path={}, branch={}, force={}, error={}",
977 request.repository_path, request.branch_name, force, e
978 );
979 format!("Failed to delete branch: {}", e)
980 })
981}
982
983#[tauri::command]
984pub async fn git_get_diff(

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected