diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-12-16 13:21:29 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-12-16 13:27:31 +0100 |
commit | 55edef25112ad4d42fbb90651d37e3b4862895e1 (patch) | |
tree | e2cf14dfa38f4a79e196cc6d291dde9146c53abf /gbp/patch_series.py | |
parent | 5426d03571f37c11da198b5d9f8450b1f1f27cc8 (diff) |
PatchSeries: Don't fail if there's only a patch end marker
If the patch only has '---' we pass empty data to git-mail-info
otherwise.
Thanks: James Cowgill for the detailed report
Closes: #916545
Diffstat (limited to 'gbp/patch_series.py')
-rw-r--r-- | gbp/patch_series.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gbp/patch_series.py b/gbp/patch_series.py index ef373a83..c47f4b6e 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -83,15 +83,19 @@ class Patch(object): break toparse.append(line) - out, err, ret = GitRepository.git_inout(command='mailinfo', - args=['-k', body.name, '/dev/null'], - input=b''.join(toparse), - extra_env=None, - cwd=None, - capture_stderr=True) - if ret != 0: - raise GbpError("Failed to read patch header of '%s': %s" % - (self.path, err)) + input = b''.join(toparse) + if input.strip(): + out, err, ret = GitRepository.git_inout(command='mailinfo', + args=['-k', body.name, '/dev/null'], + input=input, + extra_env=None, + cwd=None, + capture_stderr=True) + if ret != 0: + raise GbpError("Failed to read patch header of '%s': %s" % + (self.path, err)) + else: + out = b'' # Header for line in out.decode().split('\n'): |