Mountain/IPC/WindServiceHandlers/Git/
HandleFetch.rs1#![allow(non_snake_case)]
2
3use serde_json::Value;
8
9use crate::IPC::WindServiceHandlers::Git::Shared::RunGit;
10
11pub async fn HandleFetch(Arguments:Vec<Value>) -> Result<Value, String> {
12 let OperationId = Arguments.first().and_then(Value::as_str).unwrap_or("").to_string();
13
14 let RepoPath = Arguments.get(1).and_then(Value::as_str).unwrap_or("").to_string();
15
16 if RepoPath.is_empty() {
17 return Err("git:fetch requires repoPath".to_string());
18 }
19
20 let (ExitCode, _, Stderr) = RunGit(&OperationId, &["fetch".to_string()], Some(&RepoPath)).await?;
21
22 if ExitCode != 0 {
23 return Err(format!("git fetch failed: {}", Stderr));
24 }
25
26 Ok(Value::Null)
27}