From 6e77f64f4db9fd91b73a867dab5aa423199d0e01 Mon Sep 17 00:00:00 2001 From: alemi Date: Thu, 22 Feb 2024 05:09:38 +0100 Subject: [PATCH] fix: clone tci branch when running script --- src/tci.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tci.rs b/src/tci.rs index 74a74f6..1f4c747 100644 --- a/src/tci.rs +++ b/src/tci.rs @@ -62,12 +62,15 @@ impl Tci { &format!("tci-{}", self.repo.name.replace('/', "_")) )?; - // TODO allow customizing clone? just clone recursive? just let hook setup submodules? - git2::Repository::clone( - self.repo.path.to_str() - .ok_or(TciErr::FsError("repo path is not a valid string"))?, - tmp.path(), - )?; + // TODO recursive clone? automatically clone all submodules after? + git2::build::RepoBuilder::new() + .bare(false) + .branch("tci") + .clone( + self.repo.path.to_str() + .ok_or(TciErr::FsError("repo path is not a valid string"))?, + tmp.path(), + )?; Ok(tmp) }