toggle_index ran git checkout on connections.env whenever going down, discarding whatever set_local_db had just written and restoring whatever format happens to be committed. This silently undid the RCC_/legacy dual-format toggle. update-index still marks the file assume-unchanged/no-assume-unchanged; the checkout is gone.
25 lines
618 B
Rust
25 lines
618 B
Rust
use std::process::Command;
|
|
|
|
use anyhow::Result;
|
|
|
|
use crate::{config::parse::GLOBAL_CONNECTION_PATH, env::config::DevToolsConf};
|
|
|
|
pub fn toggle_index(start: bool, config: &DevToolsConf) -> Result<()> {
|
|
let change: &str = match start {
|
|
true => "--assume-unchanged",
|
|
false => "--no-assume-unchanged",
|
|
};
|
|
let project_path = format!(
|
|
"{}{}",
|
|
config.project_dir_as_string(),
|
|
GLOBAL_CONNECTION_PATH
|
|
);
|
|
|
|
Command::new("git")
|
|
.current_dir(config.project_dir_as_string())
|
|
.args(["update-index", change, &project_path])
|
|
.status()?;
|
|
|
|
Ok(())
|
|
}
|