Skip to content

Commit

Permalink
fix: stat diff summary performance
Browse files Browse the repository at this point in the history
  • Loading branch information
lnewson committed Mar 14, 2024
1 parent b6cf754 commit 8a3118d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-cherries-grab.md
@@ -0,0 +1,5 @@
---
"simple-git": patch
---

Fixed a performance issue when parsing stat diff summaries
4 changes: 2 additions & 2 deletions simple-git/src/lib/parsers/parse-diff-summary.ts
Expand Up @@ -6,7 +6,7 @@ import { asNumber, LineParser, orVoid, parseStringResponse } from '../utils';

const statParser = [
new LineParser<DiffResult>(
/(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,
/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,
(result, [file, changes, alterations = '']) => {
result.files.push({
file: file.trim(),
Expand All @@ -18,7 +18,7 @@ const statParser = [
}
),
new LineParser<DiffResult>(
/(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,
/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,
(result, [file, before, after]) => {
result.files.push({
file: file.trim(),
Expand Down

0 comments on commit 8a3118d

Please sign in to comment.