Skip to content

Commit

Permalink
fix(commit): trim the trailing newline from message (#403)
Browse files Browse the repository at this point in the history
When the commit message ends with a '\n', then it is not considered a valid conventional commit. That's why the message must be cleaned up.
  • Loading branch information
vbx authored Dec 23, 2023
1 parent 2c524b8 commit 514ca4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-cliff-core/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<'a> Release<'a> {
.next(
self.commits
.iter()
.map(|commit| commit.message.to_string())
.map(|commit| commit.message.trim_end().to_string())
.collect::<Vec<String>>(),
)
.to_string();
Expand Down Expand Up @@ -70,6 +70,7 @@ mod test {
("1.1.0", vec!["feat: add xyz", "fix: fix xyz"]),
("1.0.1", vec!["fix: add xyz", "fix: aaaaaa"]),
("2.0.0", vec!["feat!: add xyz", "feat: zzz"]),
("2.0.0", vec!["feat!: add xyz\n", "feat: zzz\n"]),
] {
let release = Release {
version: None,
Expand Down

0 comments on commit 514ca4b

Please sign in to comment.