git-patch-id: test for "no newline" markers
Currently, patch-id trips over our very own output that marks the absence of newline at EOF. Expose this in a test. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Feb 16, 2011 at 17:55 UTC
f2b5e7af10a2d51ce300a958c32d26ec0cf6f678
1 file changed
+36
t/t4204-patch-id.sh
+36
@@ -63,4 +63,40 @@ test_expect_success 'patch-id supports git-format-patch MIME output' '
63
test_cmp patch-id_master patch-id_same
64
'
65
66
+cat >nonl <<\EOF
67
+diff --git i/a w/a
68
+index e69de29..2e65efe 100644
69
+--- i/a
70
++++ w/a
71
+@@ -0,0 +1 @@
72
++a
73
+\ No newline at end of file
74
+diff --git i/b w/b
75
+index e69de29..6178079 100644
76
+--- i/b
77
++++ w/b
78
+@@ -0,0 +1 @@
79
++b
80
+EOF
81
+
82
+cat >withnl <<\EOF
83
+diff --git i/a w/a
84
+index e69de29..7898192 100644
85
+--- i/a
86
++++ w/a
87
+@@ -0,0 +1 @@
88
++a
89
+diff --git i/b w/b
90
+index e69de29..6178079 100644
91
+--- i/b
92
++++ w/b
93
+@@ -0,0 +1 @@
94
++b
95
+EOF
96
+
97
+test_expect_failure 'patch-id handles no-nl-at-eof markers' '
98
+ cat nonl | calc_patch_id nonl &&
99
+ cat withnl | calc_patch_id withnl &&
100
+ test_cmp patch-id_nonl patch-id_withnl
101
+'
102
test_done