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

Function git_create_branch

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

Source from the content-addressed store, hash-verified

920
921#[tauri::command]
922pub 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]
954pub async fn git_delete_branch(

Callers

nothing calls this directly

Calls 5

trimMethod · 0.80
is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected