From 4b8c1a64765b486a7d598982d1142f702ddf8f86 Mon Sep 17 00:00:00 2001 From: alemi Date: Fri, 10 May 2024 03:12:31 +0200 Subject: [PATCH] fix: clone from correct branch Co-authored-by: zaaarf --- src/tci.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tci.rs b/src/tci.rs index 31de07e..d38cc66 100644 --- a/src/tci.rs +++ b/src/tci.rs @@ -30,7 +30,6 @@ impl Tci { match self.cfg.branch.as_deref() { None => self.repo.updated("tci"), - Some("") => true, Some(b) => self.repo.updated(b), } } @@ -65,11 +64,14 @@ impl Tci { let tmp = tempdir::TempDir::new( &format!("tci-{}", self.repo.name.replace('/', "_")) )?; + + let clone_branch = self.repo.ci_branch.as_deref() + .unwrap_or_else(|| self.cfg.branch.as_deref().unwrap_or("tci")); // TODO recursive clone? automatically clone all submodules after? git2::build::RepoBuilder::new() .bare(false) - .branch("tci") + .branch(clone_branch) .clone( self.repo.path.to_str() .ok_or(TciErr::FsError("repo path is not a valid string"))?,