From 55edef25112ad4d42fbb90651d37e3b4862895e1 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 16 Dec 2018 13:21:29 +0100 Subject: 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 --- tests/08_test_patch.py | 11 +++++++++++ tests/08_test_patch_data/916545.patch | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 tests/08_test_patch_data/916545.patch (limited to 'tests') diff --git a/tests/08_test_patch.py b/tests/08_test_patch.py index 1567f018..9fe7f7fd 100644 --- a/tests/08_test_patch.py +++ b/tests/08_test_patch.py @@ -126,3 +126,14 @@ reproducible build Author: Alexis Bienvenüe """, p.long_desc) + + +class TestMarkerOnly(unittest.TestCase): + data_dir = os.path.splitext(__file__)[0] + '_data' + + def test_parse(self): + """Don't fail on empty patch header""" + patchfile = os.path.join(self.data_dir, "916545.patch") + self.assertTrue(os.path.exists(patchfile)) + p = Dep3Patch(patchfile) + self.assertEqual("916545", p.subject) diff --git a/tests/08_test_patch_data/916545.patch b/tests/08_test_patch_data/916545.patch new file mode 100644 index 00000000..46029550 --- /dev/null +++ b/tests/08_test_patch_data/916545.patch @@ -0,0 +1,5 @@ +--- +--- /dev/null ++++ b/foo +@@ -0,0 +1,1 @@ ++foo -- cgit v1.2.3