mirror of
https://git.alemi.dev/tci.git
synced 2024-11-27 02:04:49 +01:00
chore: pre-load branch override
This commit is contained in:
parent
e0e3041db7
commit
92ea79333e
2 changed files with 6 additions and 3 deletions
|
@ -4,6 +4,7 @@ pub struct TciRepo {
|
||||||
pub path: std::path::PathBuf,
|
pub path: std::path::PathBuf,
|
||||||
pub cfg: git2::Config,
|
pub cfg: git2::Config,
|
||||||
pub refs: Vec<String>,
|
pub refs: Vec<String>,
|
||||||
|
pub ci_branch: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TciRepo {
|
impl TciRepo {
|
||||||
|
@ -31,7 +32,9 @@ impl TciRepo {
|
||||||
|
|
||||||
let cfg = git2::Config::open(&path.join("config"))?;
|
let cfg = git2::Config::open(&path.join("config"))?;
|
||||||
|
|
||||||
Ok(TciRepo { name, path, cfg, refs })
|
let ci_branch = cfg.get_string("tci.branch").ok();
|
||||||
|
|
||||||
|
Ok(TciRepo { name, path, cfg, refs, ci_branch })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn updated(&self, search: &str) -> bool {
|
pub fn updated(&self, search: &str) -> bool {
|
||||||
|
|
|
@ -24,8 +24,8 @@ impl Tci {
|
||||||
return false; // we are in whitelist mode and this repo is not whitelisted
|
return false; // we are in whitelist mode and this repo is not whitelisted
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(repo_branch) = self.repo.cfg.get_str("tci.branch") {
|
if let Some(repo_branch) = &self.repo.ci_branch {
|
||||||
return self.repo.updated(repo_branch);
|
return self.repo.updated(&repo_branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.cfg.branch.as_deref() {
|
match self.cfg.branch.as_deref() {
|
||||||
|
|
Loading…
Reference in a new issue