Skip to main content

cleanup_message

Function cleanup_message 

Source
pub fn cleanup_message(messages: &[String]) -> Option<String>
Expand description

What: The commit message Git makes of the given texts when no editor opens. Why: Each text is a paragraph; Git strips trailing whitespace from every line, drops leading and trailing blank lines, squeezes runs of blank lines into one and ends the message with a newline. An empty result is no message.

In TS you’d write (pseudocode):

cleanupMessage(['subject', 'body'])