Skip to content

Commit c5227a5

Browse files
committed
Fix name replacement bug
1 parent 74363da commit c5227a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/CommitFormatter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class CommitFormatter {
1111
private array $nameReplacements = [];
1212

1313
public function __construct(array $inputCommits, array $nameReplacements = []) {
14-
$this->process($inputCommits);
1514
$this->nameReplacements = $nameReplacements;
15+
$this->process($inputCommits);
1616
}
1717

1818
private function process(array $inputCommits): void {
@@ -41,7 +41,10 @@ private function process(array $inputCommits): void {
4141
}
4242

4343
$this->commitsList = $formattedCommits;
44+
$this->groupByAuthorNames($this->commitsList, $this->nameReplacements);
45+
}
4446

47+
private function groupByAuthorNames(): void {
4548
foreach ($this->nameReplacements as $originalName => $newName) {
4649
if (isset($this->commitsGroupedByAuthor[$originalName])) {
4750
$this->commitsGroupedByAuthor[$newName] = $this->commitsGroupedByAuthor[$originalName];

0 commit comments

Comments
 (0)