Fix git-mailinfo to understand empty commit messages

From: Marco Costalba <hidden>
Date: 2016-06-15 22:42:04
Subsystem: the rest · Maintainer: Linus Torvalds

In case of empty messages git-mailinfo ignores the "---"
line adding dirty stuff in commit message otherwise empty

Signed-off-by: Marco Costalba <redacted>

---

 tools/mailinfo.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

1ebfddf05e4655811157028091d03dfce39cc4f0
diff --git a/tools/mailinfo.c b/tools/mailinfo.c
--- a/tools/mailinfo.c
+++ b/tools/mailinfo.c
@@ -273,6 +273,12 @@ int main(int argc, char ** argv)
 	}
 	while (1) {
 		int len = read_one_header_line(line, sizeof(line), stdin);
+		/* Check for empty messages */
+		if (!memcmp("---", line, 3)) {
+			line[len] = '\n';
+			handle_rest();
+			break;
+		}
 		if (!len) {
 			handle_body();
 			break;



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help