fix: clone from correct branch

Co-authored-by: zaaarf <me@zaaarf.foo>
This commit is contained in:
əlemi 2024-05-10 03:12:31 +02:00
parent 92ea79333e
commit 4b8c1a6476
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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"))?,