(
&self,
request: WorkspaceGitCheckoutRequest,
)
| 349 | } |
| 350 | |
| 351 | async fn checkout( |
| 352 | &self, |
| 353 | request: WorkspaceGitCheckoutRequest, |
| 354 | ) -> Result<WorkspaceGitCheckoutOutput> { |
| 355 | let args = if request.force { |
| 356 | vec![ |
| 357 | "checkout".to_string(), |
| 358 | "--force".to_string(), |
| 359 | request.refspec, |
| 360 | ] |
| 361 | } else { |
| 362 | vec!["checkout".to_string(), request.refspec] |
| 363 | }; |
| 364 | let (success, stdout, stderr) = self.run_git_command(args).await?; |
| 365 | if !success { |
| 366 | bail!("{}", stderr.trim_end()); |
| 367 | } |
| 368 | Ok(WorkspaceGitCheckoutOutput { stdout }) |
| 369 | } |
| 370 | |
| 371 | async fn diff(&self, request: WorkspaceGitDiffRequest) -> Result<String> { |
| 372 | self.run_blocking_git(move |root| crate::git::get_diff(&root, request.target.as_deref())) |
nothing calls this directly
no test coverage detected