There was an issue where the trailers were not properly separated from
the commit message itself. In fact, a new line is not added if there
are not trailers either.
Add a fix to add a newline after the commit message. Also adding test
cases to test 0, 1, or 2 trailers in a git commit.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
If a Commit was constructed with trailers, they would not be added to
the buffer for committing.
Fix this by parsing the message by inspecting each line for a
potential trailer, if there is one then store it for later, otherwise
keep it as part of the message. This means that a message stays intact
even if a trailer that is expected to parse did not.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
Add git trailers to the data of the Commit.
For convenience, git2 is used to extract the git trailers and they are
then converted to `OwnedTrailer`.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett