Skip to main content

DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/Command/SourceControlManagement/
CheckoutSCMBranch.rs

1//! Tauri command - switch the working tree to a different branch.
2//!
3//! ## Stub
4//!
5//! Real implementation through `SourceControlManagementProvider::Checkout`
6//! should handle uncommitted-changes prompts (stash / abort), branch creation
7//! when missing, and upstream-tracking setup.
8
9use std::sync::Arc;
10
11use serde_json::{Value, json};
12use tauri::{State, command};
13
14use crate::{ApplicationState::State::ApplicationState::ApplicationState, dev_log};
15
16#[command]
17pub async fn CheckoutSCMBranch(_State:State<'_, Arc<ApplicationState>>, BranchName:String) -> Result<Value, String> {
18	dev_log!("commands", "checking out branch: {}", BranchName);
19
20	Ok(json!({ "success": true, "message": format!("Checked out branch: {}", BranchName) }))
21}