added git update index

This commit is contained in:
2024-01-27 19:11:16 +01:00
parent 1993aca4f2
commit 5044f6a19c
6 changed files with 29 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
use std::process::Command;
use crate::config::parse::GLOBAL_CONNECTION_PATH;
pub fn toggle_index(start: bool) -> Result<(), Box<dyn std::error::Error>> {
let change: &str = match start {
true => "--assume-unchanged",
false => "--no-assume-unchanged",
};
Command::new("git")
.args(["update-index", change, "conf/global/connections.env"])
.status()?;
if !start {
Command::new("git")
.args(["checkout", GLOBAL_CONNECTION_PATH])
.status()?;
}
Ok(())
}