diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts index 7562b748..0713585f 100644 --- a/packages/core/src/tools/shell.ts +++ b/packages/core/src/tools/shell.ts @@ -406,7 +406,7 @@ Co-authored-by: ${gitCoAuthorSettings.name} <${gitCoAuthorSettings.email}>`; // Handle different git commit patterns // Match -m "message" or -m 'message' - const messagePattern = /(-m\s+)(['"])((?:[^\\]|\\.)*)(\2)/; + const messagePattern = /(-m\s+)(['"])((?:\\.|[^\\])*?)(\2)/; const match = command.match(messagePattern); if (match) {