get_branches_nbr

This commit is contained in:
hubert 2021-07-23 13:43:04 +02:00
parent f71e8ff1b3
commit 1f4d08aff1
2 changed files with 9 additions and 1 deletions

View File

@ -88,4 +88,12 @@ impl GitRepo {
res
}
pub fn get_branches_nbr(&self) -> u32 {
let mut res = 0;
for _ in self.git2.branches(Some(BranchType::Local)){
res = res + 1;
}
res
}
}

View File

@ -119,7 +119,7 @@ pub async fn git_main<T : AuthValidator>(
root : path,
user_opt : user,
revisions_nbr : gitrepo.get_revisions_nbr(),
branches_nbr : 7,
branches_nbr : gitrepo.get_branches_nbr(),
tags_nbr : 88,
size : "16 KiB".to_string(),
})