Skip to content

Commit 8c4407c

Browse files
committed
Fixes incorrect aggregate contributor stats
1 parent a7ef866 commit 8c4407c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/env/node/git/localGitProvider.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,6 +3093,16 @@ export class LocalGitProvider implements GitProvider, Disposable {
30933093
contributors.set(key, contributor);
30943094
} else {
30953095
(contributor as PickMutable<GitContributor, 'count'>).count++;
3096+
if (options?.stats && c.stats != null) {
3097+
(contributor as PickMutable<GitContributor, 'stats'>).stats =
3098+
contributor.stats == null
3099+
? c.stats
3100+
: {
3101+
additions: contributor.stats.additions + c.stats.additions,
3102+
deletions: contributor.stats.deletions + c.stats.deletions,
3103+
files: contributor.stats.files + c.stats.files,
3104+
};
3105+
}
30963106
const date = new Date(Number(c.date) * 1000);
30973107
if (date > contributor.date!) {
30983108
(contributor as PickMutable<GitContributor, 'date'>).date = date;

0 commit comments

Comments
 (0)