Skip to content

Commit 6cd32fd

Browse files
authored
fix: disable abbreviated commit shas in diff (#3337)
1 parent d121e62 commit 6cd32fd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dist/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ class GitCommandManager {
746746
'--raw',
747747
'--cc',
748748
'--no-renames',
749+
'--no-abbrev',
749750
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
750751
ref
751752
]);
@@ -761,7 +762,7 @@ class GitCommandManager {
761762
subject: detailLines[4],
762763
body: detailLines.slice(5, endOfBodyIndex).join('\n'),
763764
changes: lines.slice(endOfBodyIndex + 2, -1).map(line => {
764-
const change = line.match(/^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/);
765+
const change = line.match(/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/);
765766
if (change) {
766767
return {
767768
mode: change[3] === 'D' ? change[1] : change[2],

src/git-command-manager.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export class GitCommandManager {
160160
'--raw',
161161
'--cc',
162162
'--no-renames',
163+
'--no-abbrev',
163164
`--format=%H%n%T%n%P%n%G?%n%s%n%b%n${endOfBody}`,
164165
ref
165166
])
@@ -177,7 +178,7 @@ export class GitCommandManager {
177178
body: detailLines.slice(5, endOfBodyIndex).join('\n'),
178179
changes: lines.slice(endOfBodyIndex + 2, -1).map(line => {
179180
const change = line.match(
180-
/^:(\d{6}) (\d{6}) \w{7} \w{7} ([AMD])\s+(.*)$/
181+
/^:(\d{6}) (\d{6}) \w{40} \w{40} ([AMD])\s+(.*)$/
181182
)
182183
if (change) {
183184
return {

0 commit comments

Comments
 (0)