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

Function git_push

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

Source from the content-addressed store, hash-verified

832
833#[tauri::command]
834pub async fn git_push(
835 state: State<'_, AppState>,
836 request: GitPushRequest,
837) -> Result<GitOperationResult, String> {
838 if let Some(target) = resolve_remote_git_target(&request.repository_path).await {
839 let mut args = vec!["push".to_string()];
840 if request.params.force.unwrap_or(false) {
841 args.push("--force".to_string());
842 }
843 if request.params.set_upstream.unwrap_or(false) {
844 args.push("-u".to_string());
845 }
846 if let Some(remote) = request.params.remote {
847 args.push(remote);
848 }
849 if let Some(branch) = request.params.branch {
850 args.push(branch);
851 }
852 return execute_remote_git_operation(&state, &target, &args).await;
853 }
854
855 GitService::push(&request.repository_path, request.params)
856 .await
857 .map_err(|e| {
858 error!(
859 "Failed to push: path={}, error={}",
860 request.repository_path, e
861 );
862 format!("Failed to push: {}", e)
863 })
864}
865
866#[tauri::command]
867pub async fn git_pull(

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45

Tested by

no test coverage detected