in focus/util/src/git_helper.rs [331:348]
fn switch(&self, branch_name: &str, detach: bool) -> Result<()> {
let (mut cmd, scmd) = git_command(self.app.clone())?;
let cmd = cmd.arg("switch").current_dir(&self.repo);
if detach {
cmd.arg("--detach");
}
cmd.arg(branch_name);
if let Some(alternate_path) = &self.alternate {
cmd.env(
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
alternate_path.as_os_str(),
);
}
scmd.ensure_success_or_log(cmd, SandboxCommandOutput::Stderr)?;
Ok(())
}