aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2019-03-13 10:21:10 +0000
committerGuido Günther <agx@sigxcpu.org>2019-03-21 10:05:00 +0100
commit74669f0925b7c3d08a735d4e302b656b766d15cf (patch)
tree3d6eca9d8d9fb1c757245451edaef7d344f780f2
parent3e3458fa752d45826de6a1759e9228050825003e (diff)
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 <smcv@debian.org>
-rw-r--r--gbp/patch_series.py10
1 files changed, 10 insertions, 0 deletions
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