This commit is contained in:
Joao Moreno 2019-11-08 12:53:00 +01:00
parent dd8b177a2f
commit 062d516448
No known key found for this signature in database
GPG key ID: 9494F5E6167A8E6B

View file

@ -1813,6 +1813,12 @@ export class Repository {
}
cleanupCommitEditMessage(message: string): string {
// If the message is a single line starting with whitespace followed by `#`, just allow it.
if (/^\s*#[^\n]*$/.test(message)) {
return message;
}
// Else, remove all lines starting with whitespace followed by `#`.
//TODO: Support core.commentChar
return message.replace(/^\s*#.*$\n?/gm, '').trim();
}