From 7e05546e97dac8961ba20d3f30bbc0fe0c5c6fe7 Mon Sep 17 00:00:00 2001 From: cdesouza-chromium Date: Mon, 14 Apr 2025 09:28:07 +0100 Subject: [PATCH] Use `--default-prefix` with `update_patches` (#28610) This change adds `--default-prefix` to make sure we get the same patch format in any environment. --- build/commands/lib/updatePatches.js | 2 +- patches/tools-gritsettings-resource_ids.spec.patch | 8 ++++---- patches/tools-polymer-css_to_wrapper.py.patch | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/commands/lib/updatePatches.js b/build/commands/lib/updatePatches.js index 7dd36db205c..31708e15945 100644 --- a/build/commands/lib/updatePatches.js +++ b/build/commands/lib/updatePatches.js @@ -38,7 +38,7 @@ async function writePatchFiles (modifiedPaths, gitRepoPath, patchDirPath) { let writeOpsDoneCount = 0 let writePatchOps = modifiedPaths.map(async (old, i) => { - const singleDiffArgs = ['diff', '--src-prefix=a/', '--dst-prefix=b/', '--full-index', old] + const singleDiffArgs = ['diff', '--src-prefix=a/', '--dst-prefix=b/', '--default-prefix', '--full-index', old] const patchContents = await util.runAsync('git', singleDiffArgs, { cwd: gitRepoPath, verbose: false }) const patchFilename = patchFilenames[i] await fs.writeFile(path.join(patchDirPath, patchFilename), patchContents) diff --git a/patches/tools-gritsettings-resource_ids.spec.patch b/patches/tools-gritsettings-resource_ids.spec.patch index fae4279b04a..67a77d1ed72 100644 --- a/patches/tools-gritsettings-resource_ids.spec.patch +++ b/patches/tools-gritsettings-resource_ids.spec.patch @@ -1,7 +1,7 @@ -diff --git i/tools/gritsettings/resource_ids.spec w/tools/gritsettings/resource_ids.spec -index 2cd6ca756a745..decd3cac99da6 100644 ---- i/tools/gritsettings/resource_ids.spec -+++ w/tools/gritsettings/resource_ids.spec +diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec +index 2cd6ca756a745e1387469914eb3d649dff104ccb..decd3cac99da6366259c9e425ec55ec775590fe7 100644 +--- a/tools/gritsettings/resource_ids.spec ++++ b/tools/gritsettings/resource_ids.spec @@ -38,6 +38,9 @@ "chrome/app/chromium_strings.grd": { "messages": [800], diff --git a/patches/tools-polymer-css_to_wrapper.py.patch b/patches/tools-polymer-css_to_wrapper.py.patch index 261b0ebbb19..4b088ecbae6 100644 --- a/patches/tools-polymer-css_to_wrapper.py.patch +++ b/patches/tools-polymer-css_to_wrapper.py.patch @@ -1,7 +1,7 @@ -diff --git i/tools/polymer/css_to_wrapper.py w/tools/polymer/css_to_wrapper.py -index d76a3aa579e89..900ec9159da17 100644 ---- i/tools/polymer/css_to_wrapper.py -+++ w/tools/polymer/css_to_wrapper.py +diff --git a/tools/polymer/css_to_wrapper.py b/tools/polymer/css_to_wrapper.py +index d76a3aa579e895ec9f237c76e022a3ebaafc02a3..900ec9159da17da16fd546116a96631333583bff 100644 +--- a/tools/polymer/css_to_wrapper.py ++++ b/tools/polymer/css_to_wrapper.py @@ -275,7 +275,7 @@ def main(argv): content = ''