mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: export patches not retaining CRLF line endings (#28360)
When a patch targets a file using CRLF line endings, they need to be retained in the patch file. Otherwise the patch will fail to apply due to being unable to find surrounding lines with matching whitespace.
This commit is contained in:
@@ -207,7 +207,7 @@ const LINTERS = [{
|
||||
console.warn(`Patch file '${f}' has no description. Every patch must contain a justification for why the patch exists and the plan for its removal.`);
|
||||
return false;
|
||||
}
|
||||
const trailingWhitespace = patchText.split('\n').filter(line => line.startsWith('+')).some(line => /\s+$/.test(line));
|
||||
const trailingWhitespace = patchText.split(/\r?\n/).some(line => line.startsWith('+') && /\s+$/.test(line));
|
||||
if (trailingWhitespace) {
|
||||
console.warn(`Patch file '${f}' has trailing whitespace on some lines.`);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user