Skip to content

Commit

Permalink
Merge pull request #982 from lnewson/lnewson-diff-perf
Browse files Browse the repository at this point in the history
fix: stat diff summary performance
  • Loading branch information
steveukx authored Mar 17, 2024
2 parents 994f2e3 + 8a3118d commit 175ae77
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 175ae77

Please sign in to comment.