summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorBrian Lyles <brianmlyles@gmail.com>2024-09-06 09:50:08 -0500
committerJunio C Hamano <gitster@pobox.com>2024-09-06 09:21:44 -0700
commitc02414a99796487a2124e4dbb17c3a88c8606404 (patch)
tree83af73811fe72f1a9b0f0df1a875319a5096a31b /commit.c
parent39bf06adf96da25b87c9aa7d35a32ef3683eb4a4 (diff)
interpret-trailers: handle message without trailing newline
When git-interpret-trailers is used to add a trailer to a message that does not end in a trailing newline, the new trailer is added on the line immediately following the message instead of as a trailer block separated from the message by a blank line. For example, if a message's text was exactly "The subject" with no trailing newline present, `git interpret-trailers --trailer my-trailer=true` will result in the following malformed commit message: The subject my-trailer: true While it is generally expected that a commit message should end with a newline character, git-interpret-trailers should not be returning an invalid message in this case. Use `strbuf_complete_line` to ensure that the message ends with a newline character when reading the input. Signed-off-by: Brian Lyles <brianmlyles@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions