diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-11-08 11:09:10 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-11-08 11:34:46 +0100 |
commit | 1994bb27cff3468816ad919803e7576eae259b26 (patch) | |
tree | d4e0e8455a563ed034743e311cd292fc2bf3b467 /tests/08_test_patch.py | |
parent | 370244733d44eaf509d242d30b5dddbb26f53fde (diff) |
PatchSeries: Only pass patch description and header to git-mailinfo
There are patches around that use
Content-Transfer-Encoding: base64
but the actual patch after '---' is unencoded ascii resulting in garbage
after the patch description when imported into a patch queue.
Since we're discarding the patch part of git-mailinfo anyway don't pass
this on in the first place.
Closes: #912426
Diffstat (limited to 'tests/08_test_patch.py')
-rw-r--r-- | tests/08_test_patch.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/08_test_patch.py b/tests/08_test_patch.py index c0f3e5ce..1567f018 100644 --- a/tests/08_test_patch.py +++ b/tests/08_test_patch.py @@ -102,3 +102,27 @@ usbip_common.c has the same problem. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> """, p.long_desc) + + +class TestBase64Patch(unittest.TestCase): + data_dir = os.path.splitext(__file__)[0] + '_data' + + def test_parse(self): + """Get patch information from git mailimport with base64 body but plain text patch""" + patchfile = os.path.join(self.data_dir, "base64.patch") + self.assertTrue(os.path.exists(patchfile)) + p = Dep3Patch(patchfile) + self.assertEqual("Sort files in archive (reproducible builds)", p.subject) + self.assertEqual("Nick Leverton", p.author) + self.assertEqual("nick@leverton.org", p.email) + self.assertEqual("""\ +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: base64 + +Sort files when using mergelib to create libnullmailer.a, to get +reproducible build + +Author: Alexis Bienvenüe <pado@passoire.fr> +""", + p.long_desc) |