Skip to main content

Mountain/Command/SourceControlManagement/
GetSCMBranches.rs

1#![allow(non_snake_case)]
2
3//! Tauri command - list branches for an SCM provider. Drives the
4//! branch picker UI.
5//!
6//! TODO: stub. Wire to `SourceControlManagementProvider::GetBranches`
7//! so local + remote branches with tracking relationships and
8//! current-branch indicator are returned.
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 GetSCMBranches(
19	_State:State<'_, Arc<ApplicationState>>,
20	ProviderIdentifier:String,
21) -> Result<Value, String> {
22	dev_log!("commands", "getting branches for provider: {}", ProviderIdentifier);
23
24	Ok(json!({
25		"branches": [
26			{ "name": "main", "isCurrent": true },
27			{ "name": "develop", "isCurrent": false },
28		],
29	}))
30}