From 6cd32fd93684475c31847837f87bb135d40a2b79 Mon Sep 17 00:00:00 2001 From: Peter Evans <18365890+peter-evans@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:17:19 +0100 Subject: [PATCH] fix: disable abbreviated commit shas in diff (#3337) --- dist/index.js | 3 ++- src/git-command-manager.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index cc5df6a9bd..f2b3a02a0f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -746,6 +746,7 @@ class GitCommandManager { '--raw', '--cc', '--no-renames', + '--no-abbrev', `--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`, ref ]); @@ -761,7 +762,7 @@ class GitCommandManager { subject: detailLines[4], body: detailLines.slice(5, endOfBodyIndex).join('\n'), changes: lines.slice(endOfBodyIndex + 2, -1).map(line => { - const change = line.match(/^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/); + const change = line.match(/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/); if (change) { return { mode: change[3] === 'D' ? change[1] : change[2], diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 016f3e8418..b17e1f3d05 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -160,6 +160,7 @@ export class GitCommandManager { '--raw', '--cc', '--no-renames', + '--no-abbrev', `--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`, ref ]) @@ -177,7 +178,7 @@ export class GitCommandManager { body: detailLines.slice(5, endOfBodyIndex).join('\n'), changes: lines.slice(endOfBodyIndex + 2, -1).map(line => { const change = line.match( - /^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/ + /^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/ ) if (change) { return {