From 74669f0925b7c3d08a735d4e302b656b766d15cf Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 13 Mar 2019 10:21:10 +0000 Subject: Dep3Patch: Ignore MIME headers Otherwise, if we import a patch containing non-ASCII characters exported by `gbp pq export` or `git format-patch` using DEP-3 syntax, we'd misinterpret these fields as semantically significant and copy them into pseudo-headers, causing them to be duplicated in the commit's long description. Closes: #924478 Signed-off-by: Simon McVittie --- gbp/patch_series.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gbp/patch_series.py b/gbp/patch_series.py index c47f4b6e..7b561e62 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -255,6 +255,16 @@ class Dep3Patch(Patch): changes += add_date(v) elif k == 'long_desc': pass + elif k in ( + 'content-transfer-encoding', + 'content-type', + 'mime-version', + ): + # These can appear in `git format-patch` or `gbp pq export` + # output. They are not semantically significant: they're + # part of the encoding of the patch as an email, rather + # than real patch metadata. + pass else: pseudo_headers += ''.join(v) changes += 1 -- cgit v1.2.3