(
state: &AppState,
target: &RemoteGitTarget,
args: &[String],
)
| 101 | } |
| 102 | |
| 103 | async fn execute_remote_git_operation( |
| 104 | state: &AppState, |
| 105 | target: &RemoteGitTarget, |
| 106 | args: &[String], |
| 107 | ) -> Result<GitOperationResult, String> { |
| 108 | let output = execute_remote_git_command(state, target, args).await?; |
| 109 | let success = output.exit_code == 0; |
| 110 | let error = (!success).then(|| { |
| 111 | if output.stderr.trim().is_empty() { |
| 112 | output.stdout.trim().to_string() |
| 113 | } else { |
| 114 | output.stderr.trim().to_string() |
| 115 | } |
| 116 | }); |
| 117 | |
| 118 | Ok(GitOperationResult { |
| 119 | success, |
| 120 | data: Some(serde_json::json!({ |
| 121 | "remoteExecution": true, |
| 122 | "exitCode": output.exit_code, |
| 123 | })), |
| 124 | error, |
| 125 | output: Some(output.stdout), |
| 126 | duration: None, |
| 127 | }) |
| 128 | } |
| 129 | |
| 130 | fn parse_remote_status_line( |
| 131 | line: &str, |
no test coverage detected