Skip to main content

Mountain/Command/SourceControlManagement/
CheckoutSCMBranch.rs

1#![allow(non_snake_case)]
2
3//! Tauri command - switch the working tree to a different branch.
4//!
5//! TODO: stub. Real impl through
6//! `SourceControlManagementProvider::Checkout` should handle
7//! uncommitted-changes prompts (stash / abort), branch creation
8//! when missing, and upstream-tracking setup.
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 CheckoutSCMBranch(_State:State<'_, Arc<ApplicationState>>, BranchName:String) -> Result<Value, String> {
19	dev_log!("commands", "checking out branch: {}", BranchName);
20	Ok(json!({ "success": true, "message": format!("Checked out branch: {}", BranchName) }))
21}