Branches will only count up if there's at least 1 commit visible from them, similiar to how repo or commits counters work

master
Wynd 2025-01-05 12:35:33 +02:00
parent 50b3f95b1d
commit de2b6190d5
1 changed files with 3 additions and 4 deletions

View File

@ -257,15 +257,13 @@ fn get_commits(
branches.extend(branch_names);
}
branches_count += branches.len();
let mailmap = Mailmap::new(repo_path);
let mut has_commits = false;
for branch in branches {
for branch in &branches {
// When passing the default @ (HEAD) branch this might actually not exist at all
// locally so we're skipping it
let Ok(rev) = repo.rev_parse(&*branch)
let Ok(rev) = repo.rev_parse(&**branch)
else {
continue;
};
@ -334,6 +332,7 @@ fn get_commits(
if has_commits {
repos_count += 1;
branches_count += branches.len();
}
}