зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
dfd66ddf5a
Коммит
2887103b35
|
@ -804,8 +804,10 @@ static int process_input_file(struct strbuf **lines,
|
||||||
|
|
||||||
/* Parse trailer lines */
|
/* Parse trailer lines */
|
||||||
for (i = trailer_start; i < patch_start; i++) {
|
for (i = trailer_start; i < patch_start; i++) {
|
||||||
struct trailer_item *new = create_trailer_item(lines[i]->buf);
|
if (lines[i]->buf[0] != comment_line_char) {
|
||||||
add_trailer_item(in_tok_first, in_tok_last, new);
|
struct trailer_item *new = create_trailer_item(lines[i]->buf);
|
||||||
|
add_trailer_item(in_tok_first, in_tok_last, new);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return patch_start;
|
return patch_start;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче