Skip to main content

Mountain/Command/SourceControlManagement/
GetSCMBranches.rs

1
2//! Tauri command - list branches for an SCM provider. Drives the
3//! branch picker UI.
4//!
5//! ## Stub
6//!
7//! Wire to `SourceControlManagementProvider::GetBranches` so local
8//! and remote branches with tracking relationships and current-branch
9//! indicator are returned.
10
11use std::sync::Arc;
12
13use serde_json::{Value, json};
14use tauri::{State, command};
15
16use crate::{ApplicationState::State::ApplicationState::ApplicationState, dev_log};
17
18#[command]
19pub async fn GetSCMBranches(
20	_State:State<'_, Arc<ApplicationState>>,
21
22	ProviderIdentifier:String,
23) -> Result<Value, String> {
24	dev_log!("commands", "getting branches for provider: {}", ProviderIdentifier);
25
26	Ok(json!({
27		"branches": [
28			{ "name": "main", "isCurrent": true },
29			{ "name": "develop", "isCurrent": false },
30		],
31	}))
32}