[READ-ONLY] Mirror of https://github.com/SantaClaas/gigit. git client
Something went wrong. Try again.
Rust
at ref-filter
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889//! The Tauri command surface.//!//! Every command is a thin translation between the IPC boundary and the//! workspace actor. No logic lives here.
use std::path::PathBuf;
use gigit_git::{RefEntry, RepositorySummary};use tauri::ipc::Channel;use tauri::State;
use crate::error::Result;use crate::graph_stream::GraphEvent;use crate::recents::{RecentRepository, RecentsHandle};use crate::workspace::{OpenedRepository, RepositoryId, WorkspaceHandle};
#[tauri::command]pub async fn open_repository( path: PathBuf, workspace: State<'_, WorkspaceHandle>,) -> Result<OpenedRepository> { workspace.open(path).await}
#[tauri::command]pub async fn close_repository( id: RepositoryId, workspace: State<'_, WorkspaceHandle>,) -> Result<bool> { workspace.close(id).await}
#[tauri::command]pub async fn repository_summary( id: RepositoryId, workspace: State<'_, WorkspaceHandle>,) -> Result<RepositorySummary> { workspace.summary(id).await}
#[tauri::command]pub async fn list_references( id: RepositoryId, workspace: State<'_, WorkspaceHandle>,) -> Result<Vec<RefEntry>> { workspace.references(id).await}
/// Start streaming the commit graph.////// `budget` is how many rows may be sent before the frontend asks for more —/// enough to fill the first screen, typically.#[tauri::command]pub async fn stream_graph( id: RepositoryId, channel: Channel<GraphEvent>, budget: usize, workspace: State<'_, WorkspaceHandle>,) -> Result<()> { workspace.stream_graph(id, channel, budget).await}
/// Allow the running stream to send `rows` more rows.#[tauri::command]pub async fn request_more_rows( id: RepositoryId, rows: usize, workspace: State<'_, WorkspaceHandle>,) -> Result<()> { workspace.request_more_rows(id, rows).await}
/// Repositories opened before, most recent first.#[tauri::command]pub async fn list_recent_repositories( recents: State<'_, RecentsHandle>,) -> Result<Vec<RecentRepository>> { recents.list().await}
/// Drop a repository from the recents list. Returns whether it was there.#[tauri::command]pub async fn forget_recent_repository( id: RepositoryId, recents: State<'_, RecentsHandle>,) -> Result<bool> { recents.forget(id).await}