difit 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,8 +24,9 @@ export class GitDiffParser {
24
24
  if (ignoreWhitespace) {
25
25
  diffArgs.push('-w');
26
26
  }
27
+ // Add --color=never to ensure plain text output without ANSI escape sequences
27
28
  const diffSummary = await this.git.diffSummary(diffArgs);
28
- const diffRaw = await this.git.diff(diffArgs);
29
+ const diffRaw = await this.git.diff(['--color=never', ...diffArgs]);
29
30
  const files = this.parseUnifiedDiff(diffRaw, diffSummary.files);
30
31
  return {
31
32
  commit: resolvedCommit,
@@ -54,7 +55,7 @@ export class GitDiffParser {
54
55
  parseFileBlock(block, summary) {
55
56
  const lines = block.split('\n');
56
57
  const headerLine = lines[0];
57
- const pathMatch = headerLine.match(/^diff --git a\/(.+) b\/(.+)$/);
58
+ const pathMatch = headerLine.match(/^diff --git [a-z]\/(.+) [a-z]\/(.+)$/);
58
59
  if (!pathMatch)
59
60
  return null;
60
61
  const oldPath = pathMatch[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "difit",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "A lightweight command-line tool that spins up a local web server to display Git commit diffs in a GitHub-like Files changed view",
5
5
  "type": "module",
6
6
  "engines": {