(
state: State<'_, AppState>,
startup_trace: State<'_, DesktopStartupTrace>,
request: GitRepositoryRequest,
)
| 504 | |
| 505 | #[tauri::command] |
| 506 | pub async fn git_is_repository( |
| 507 | state: State<'_, AppState>, |
| 508 | startup_trace: State<'_, DesktopStartupTrace>, |
| 509 | request: GitRepositoryRequest, |
| 510 | ) -> Result<bool, String> { |
| 511 | let trace_started = Instant::now(); |
| 512 | let result = if let Some(target) = resolve_remote_git_target(&request.repository_path).await { |
| 513 | execute_remote_git_command( |
| 514 | &state, |
| 515 | &target, |
| 516 | &["rev-parse".to_string(), "--is-inside-work-tree".to_string()], |
| 517 | ) |
| 518 | .await |
| 519 | .map(|output| output.exit_code == 0 && output.stdout.trim() == "true") |
| 520 | } else { |
| 521 | GitService::is_repository(&request.repository_path) |
| 522 | .await |
| 523 | .map_err(|e| { |
| 524 | error!( |
| 525 | "Failed to check Git repository: path={}, error={}", |
| 526 | request.repository_path, e |
| 527 | ); |
| 528 | format!("Failed to check Git repository: {}", e) |
| 529 | }) |
| 530 | }; |
| 531 | |
| 532 | startup_trace.record_tauri_command_elapsed("git_is_repository", None, trace_started); |
| 533 | result |
| 534 | } |
| 535 | |
| 536 | #[tauri::command] |
| 537 | pub async fn git_get_repository( |
nothing calls this directly
no test coverage detected