Skip to content

Commit

Permalink
fix: disable abbreviated commit shas in diff (#3337)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored Sep 16, 2024
1 parent d121e62 commit 6cd32fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
]);
Expand All @@ -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],
Expand Down
3 changes: 2 additions & 1 deletion src/git-command-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
Expand All @@ -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 {
Expand Down

0 comments on commit 6cd32fd

Please sign in to comment.