fix: normalize line endings in file diffs (#1306)
Prevents CRLF-only changes from flooding diff view Keeps text diffs focused on real content changes
This commit is contained in:
@@ -1752,8 +1752,8 @@ export async function getFileDiff(directory, { path: filePath, staged = false }
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
original,
|
original: typeof original === 'string' ? original.replace(/\r\n/g, '\n') : original,
|
||||||
modified,
|
modified: typeof modified === 'string' ? modified.replace(/\r\n/g, '\n') : modified,
|
||||||
path: filePath,
|
path: filePath,
|
||||||
isBinary: false,
|
isBinary: false,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user