From de2b6190d54056d9e1388d7fae4ed96bfc70ad2f Mon Sep 17 00:00:00 2001 From: Wynd Date: Sun, 5 Jan 2025 12:35:33 +0200 Subject: [PATCH] Branches will only count up if there's at least 1 commit visible from them, similiar to how repo or commits counters work --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1c43943..05396fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(); } }