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

Function git_cherry_pick

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

Source from the content-addressed store, hash-verified

1160
1161#[tauri::command]
1162pub async fn git_cherry_pick(
1163 state: State<'_, AppState>,
1164 request: GitCherryPickRequest,
1165) -> Result<GitOperationResult, String> {
1166 let no_commit = request.no_commit.unwrap_or(false);
1167
1168 info!(
1169 "Cherry-picking commit '{}' in repo '{}' (no_commit: {})",
1170 request.commit_hash, request.repository_path, no_commit
1171 );
1172
1173 if let Some(target) = resolve_remote_git_target(&request.repository_path).await {
1174 let mut args = vec!["cherry-pick".to_string()];
1175 if no_commit {
1176 args.push("-n".to_string());
1177 }
1178 args.push(request.commit_hash);
1179 return execute_remote_git_operation(&state, &target, &args).await;
1180 }
1181
1182 GitService::cherry_pick(&request.repository_path, &request.commit_hash, no_commit)
1183 .await
1184 .map_err(|e| {
1185 error!(
1186 "Failed to cherry-pick: path={}, commit={}, no_commit={}, error={}",
1187 request.repository_path, request.commit_hash, no_commit, e
1188 );
1189 format!("Failed to cherry-pick: {}", e)
1190 })
1191}
1192
1193#[tauri::command]
1194pub async fn git_cherry_pick_abort(

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45

Tested by

no test coverage detected