From 062d516448a70606a35f3a8cc47fb0787b60b045 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 8 Nov 2019 12:53:00 +0100 Subject: [PATCH] fixes #84201 --- extensions/git/src/git.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index a397664fea4..23a68ca7c16 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -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(); }