added git update index
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
Reference in New Issue
Block a user