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.
- package/dist/server/git-diff.js +3 -2
- package/package.json +1 -1
package/dist/server/git-diff.js
CHANGED
|
@@ -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\/(.+)
|
|
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