From 060c84da1ca8965aa568e8e69fca0bdc40e30be9 Mon Sep 17 00:00:00 2001 From: Antoine Gaudreau Simard Date: Fri, 12 Apr 2024 12:42:59 -0400 Subject: [PATCH] fix: ignore empty lines when using split_commits fix #606 --- git-cliff-core/src/changelog.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/git-cliff-core/src/changelog.rs b/git-cliff-core/src/changelog.rs index 4014c95b47..662c306683 100644 --- a/git-cliff-core/src/changelog.rs +++ b/git-cliff-core/src/changelog.rs @@ -94,10 +94,14 @@ impl<'a> Changelog<'a> { commit .message .lines() - .flat_map(|line| { + .filter_map(|line| { let mut c = commit.clone(); c.message = line.to_string(); - Self::process_commit(c, &self.config.git) + if !c.message.is_empty() { + Self::process_commit(c, &self.config.git) + } else { + None + } }) .collect() } else { @@ -722,6 +726,7 @@ style: make awesome stuff look better String::from("123abc"), String::from( "chore(deps): bump some deps + chore(deps): bump some more deps chore(deps): fix broken deps ",