]> granicus.if.org Git - git/commitdiff
trailer: ignore comment lines inside the trailers
authorChristian Couder <chriscool@tuxfamily.org>
Sun, 9 Nov 2014 09:23:39 +0000 (10:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Nov 2014 17:43:16 +0000 (09:43 -0800)
Otherwise trailers that are commented out might be
processed. We would also error out if the comment line
char is also a separator.

This means that comments inside a trailer block will
disappear, but that was already the case anyway.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
trailer.c

index 85145665640d3569b5513c712335da4de21743d3..761b763d4d29ba68a8017a3c214c07872c986399 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -804,8 +804,10 @@ static int process_input_file(struct strbuf **lines,
 
        /* Parse trailer lines */
        for (i = trailer_start; i < patch_start; i++) {
-               struct trailer_item *new = create_trailer_item(lines[i]->buf);
-               add_trailer_item(in_tok_first, in_tok_last, new);
+               if (lines[i]->buf[0] != comment_line_char) {
+                       struct trailer_item *new = create_trailer_item(lines[i]->buf);
+                       add_trailer_item(in_tok_first, in_tok_last, new);
+               }
        }
 
        return patch_start;