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//! ## Stub
6//!
7//! Real implementation through `SourceControlManagementProvider::Checkout`
8//! should handle uncommitted-changes prompts (stash / abort), branch creation
9//! when missing, and upstream-tracking setup.
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 CheckoutSCMBranch(_State:State<'_, Arc<ApplicationState>>, BranchName:String) -> Result<Value, String> {
20	dev_log!("commands", "checking out branch: {}", BranchName);
21
22	Ok(json!({ "success": true, "message": format!("Checked out branch: {}", BranchName) }))
23}