diff --git a/crates/committed/src/checks.rs b/crates/committed/src/checks.rs index 9b426b8..3a0fd79 100644 --- a/crates/committed/src/checks.rs +++ b/crates/committed/src/checks.rs @@ -3,7 +3,7 @@ use committed::Style; pub(crate) fn check_message( source: report::Source<'_>, - message: &str, + mut message: &str, config: &crate::config::Config, report: report::Report, ) -> Result { @@ -19,6 +19,7 @@ pub(crate) fn check_message( } if config.no_fixup() { failed |= check_fixup(source, message, report)?; + message = strip_fixup(message); } // Bail out due to above checks if failed { @@ -356,6 +357,14 @@ pub(crate) fn check_fixup( } } +pub(crate) fn strip_fixup(message: &str) -> &str { + if let Some(message) = message.strip_prefix(FIXUP_PREFIX) { + message + } else { + message + } +} + const FIXUP_PREFIX: &str = "fixup! "; pub(crate) fn check_merge_commit(