(
state: State<'_, AppState>,
request: GitRepositoryRequest,
)
| 654 | |
| 655 | #[tauri::command] |
| 656 | pub async fn git_get_status( |
| 657 | state: State<'_, AppState>, |
| 658 | request: GitRepositoryRequest, |
| 659 | ) -> Result<GitStatus, String> { |
| 660 | if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 661 | let output = execute_remote_git_success( |
| 662 | &state, |
| 663 | &target, |
| 664 | &[ |
| 665 | "status".to_string(), |
| 666 | "--porcelain=v1".to_string(), |
| 667 | "--branch".to_string(), |
| 668 | ], |
| 669 | ) |
| 670 | .await?; |
| 671 | return Ok(parse_remote_git_status(&output)); |
| 672 | } |
| 673 | |
| 674 | GitService::get_status(&request.repository_path) |
| 675 | .await |
| 676 | .map_err(|e| { |
| 677 | error!( |
| 678 | "Failed to get Git status: path={}, error={}", |
| 679 | request.repository_path, e |
| 680 | ); |
| 681 | format!("Failed to get Git status: {}", e) |
| 682 | }) |
| 683 | } |
| 684 | |
| 685 | #[tauri::command] |
| 686 | pub async fn git_get_branches( |
nothing calls this directly
no test coverage detected