summaryrefslogtreecommitdiff
path: root/trailer.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2014-11-09 09:23:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-11-10 17:43:16 (GMT)
commit2887103b35b3b40025ca5060713dfb1e1c8c3b20 (patch)
tree243aead0a219efb8e8131a10bfd15c9dabd24a7d /trailer.c
parentdfd66ddf5aa9aacc06ed38a9ee2cc15a4f2d4896 (diff)
downloadgit-2887103b35b3b40025ca5060713dfb1e1c8c3b20.zip
git-2887103b35b3b40025ca5060713dfb1e1c8c3b20.tar.gz
git-2887103b35b3b40025ca5060713dfb1e1c8c3b20.tar.bz2
trailer: ignore comment lines inside the trailers
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>
Diffstat (limited to 'trailer.c')
-rw-r--r--trailer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/trailer.c b/trailer.c
index 8514566..761b763 100644
--- 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;