From e6c64ba827e8dc077b172b714151ef9e21b6f3ef Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Tue, 28 Oct 2025 14:12:16 +0000 Subject: pkg/email: add test for git patches containing empty lines --- pkg/email/patch_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'pkg/email/patch_test.go') diff --git a/pkg/email/patch_test.go b/pkg/email/patch_test.go index a2be0d6c9..cffdebaec 100644 --- a/pkg/email/patch_test.go +++ b/pkg/email/patch_test.go @@ -25,6 +25,40 @@ var tests = []struct { }{ { text: ` +So that's my patch +diff --git a/foo/bar/foobar.c b/foo/bar/foobar.c +--- a/foo/bar/foobar.c ++++ b/foo/bar/foobar.c +@@ -2,7 +2,7 @@ + u32 chars = len; + int not_chars; + +- if (!len) ++ if (!len || !ln) + return 1; + + return 0; + +Watch out for the empty lines! +`, + title: ``, + diff: `diff --git a/foo/bar/foobar.c b/foo/bar/foobar.c +--- a/foo/bar/foobar.c ++++ b/foo/bar/foobar.c +@@ -2,7 +2,7 @@ + u32 chars = len; + int not_chars; + +- if (!len) ++ if (!len || !ln) + return 1; + + return 0; + +`, + }, + { + text: ` commit 7bdb59aaaaaa4bd7161adc8f923cdef10f2638d1 Author: Some foo-bar รกลก Date: Tue Feb 7 17:44:54 2017 +0100 -- cgit mrf-deployment