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 fb6f604 commit 039be2eCopy full SHA for 039be2e
script/lib/patches.py
@@ -7,10 +7,12 @@ def read_patch(patch_dir, patch_filename):
7
"""Read a patch from |patch_dir/filename| and amend the commit message with
8
metadata about the patch file it came from."""
9
ret = []
10
+ added_filename_line = False
11
with open(os.path.join(patch_dir, patch_filename)) as f:
12
for l in f.readlines():
- if l.startswith('diff -'):
13
+ if not added_filename_line and (l.startswith('diff -') or l.startswith('---')):
14
ret.append('Patch-Filename: {}\n'.format(patch_filename))
15
+ added_filename_line = True
16
ret.append(l)
17
return ''.join(ret)
18
0 commit comments