From 40597a17514a3491ceb4a4ed220074286f76631a Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 12 Mar 2026 17:46:43 +0000 Subject: [PATCH] fix(ng-dev/release): escape double quotes in snapshot commit message When creating a snapshot commit, the snapshot message might contain double quotes which need to be properly escaped when passed to the git command line. This fixes an issue where the `git commit -m` command fails or produces incorrectly formatted messages if the snapshot message contains quotes. --- ng-dev/release/snapshot-publish/snapshots.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ng-dev/release/snapshot-publish/snapshots.ts b/ng-dev/release/snapshot-publish/snapshots.ts index e71016a30..6c4aef7d8 100644 --- a/ng-dev/release/snapshot-publish/snapshots.ts +++ b/ng-dev/release/snapshot-publish/snapshots.ts @@ -161,9 +161,16 @@ export class SnapshotPublisher { ['diff-index', '--quiet', '-I', '0\\.0\\.0-[a-f0-9]+', 'HEAD', '--'], {cwd: tmpRepoDir}, ).status === 1; - this.git.run(['commit', '--author', this.commitAuthor, '-m', this.snapshotCommitMessage], { - cwd: tmpRepoDir, - }); + this.git.run( + [ + 'commit', + '--author', + this.commitAuthor, + '-m', + `"${this.snapshotCommitMessage.replace(/"/g, '\\"')}"`, + ], + {cwd: tmpRepoDir}, + ); return { url,