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

Function git_checkout_branch

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

Source from the content-addressed store, hash-verified

895
896#[tauri::command]
897pub async fn git_checkout_branch(
898 state: State<'_, AppState>,
899 request: GitCheckoutBranchRequest,
900) -> Result<GitOperationResult, String> {
901 if let Some(target) = resolve_remote_git_target(&request.repository_path).await {
902 return execute_remote_git_operation(
903 &state,
904 &target,
905 &["checkout".to_string(), request.branch_name],
906 )
907 .await;
908 }
909
910 GitService::checkout_branch(&request.repository_path, &request.branch_name)
911 .await
912 .map_err(|e| {
913 error!(
914 "Failed to checkout branch: path={}, branch={}, error={}",
915 request.repository_path, request.branch_name, e
916 );
917 format!("Failed to checkout branch: {}", e)
918 })
919}
920
921#[tauri::command]
922pub async fn git_create_branch(

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected