Skip to main content

Mountain/Command/SourceControlManagement/
GetSCMCommitHistory.rs

1#![allow(non_snake_case)]
2
3//! Tauri command - paginated commit log for the SCM viewlet's
4//! Timeline panel.
5//!
6//! TODO: stub. Wire to `SourceControlManagementProvider::GetHistory`;
7//! return structured commits with hash, author, date, message,
8//! parents.
9
10use std::sync::Arc;
11
12use serde_json::{Value, json};
13use tauri::{State, command};
14
15use crate::{ApplicationState::State::ApplicationState::ApplicationState, dev_log};
16
17#[command]
18pub async fn GetSCMCommitHistory(
19	_State:State<'_, Arc<ApplicationState>>,
20	MaxCount:Option<usize>,
21) -> Result<Value, String> {
22	dev_log!("commands", "getting commit history, max count: {:?}", MaxCount);
23	let MaxCommits = MaxCount.unwrap_or(50);
24	Ok(json!({
25		"commits": Vec::<Value>::new(),
26		"maxCount": MaxCommits,
27	}))
28}