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

Function git_get_status

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

Source from the content-addressed store, hash-verified

654
655#[tauri::command]
656pub 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]
686pub async fn git_get_branches(

Callers

nothing calls this directly

Calls 3

parse_remote_git_statusFunction · 0.85

Tested by

no test coverage detected