Skip to content

Commit

Permalink
trailer: ignore comment lines inside the trailers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Nov 10, 2014
1 parent dfd66dd commit 2887103
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions trailer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2887103

Please sign in to comment.