We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5154e8f commit 9055048Copy full SHA for 9055048
script/lib/patches.py
@@ -8,11 +8,13 @@ def read_patch(patch_dir, patch_filename):
8
"""Read a patch from |patch_dir/filename| and amend the commit message with
9
metadata about the patch file it came from."""
10
ret = []
11
+ added_filename_line = False
12
patch_path = os.path.join(patch_dir, patch_filename)
13
with codecs.open(patch_path, encoding='utf-8') as f:
14
for l in f.readlines():
- if l.startswith('diff -'):
15
+ if not added_filename_line and (l.startswith('diff -') or l.startswith('---')):
16
ret.append('Patch-Filename: {}\n'.format(patch_filename))
17
+ added_filename_line = True
18
ret.append(l)
19
return ''.join(ret)
20
0 commit comments