aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorPimyn Girgis <pimyn@google.com>2025-10-28 14:12:16 +0000
committerAleksandr Nogikh <nogikh@google.com>2025-11-03 13:16:31 +0000
commite6c64ba827e8dc077b172b714151ef9e21b6f3ef (patch)
tree263c198b6a1ac8c3e95542351c82cc6f648c6316 /pkg
parent317f89e1cd7cc8300ded51c3a24c8aa7839b52c8 (diff)
pkg/email: add test for git patches containing empty lines
Diffstat (limited to 'pkg')
-rw-r--r--pkg/email/patch_test.go34
1 files changed, 34 insertions, 0 deletions
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 áš <foo@bar.com>
Date: Tue Feb 7 17:44:54 2017 +0100