Skip to content

Commit 38ccbe5

Browse files
committed
Fixes wip stats
1 parent ca82111 commit 38ccbe5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/git/models/commit.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,9 @@ export class GitCommit implements GitRevisionReference {
319319
this._recomputeStats = true;
320320
this.computeFileStats();
321321

322-
const stats = await repo?.git.diff.getChangedFilesCount(this.sha);
322+
const stats = await repo?.git.diff.getChangedFilesCount(
323+
this.isUncommittedStaged ? uncommitted : 'HEAD',
324+
);
323325
if (stats != null) {
324326
if (this._stats != null) {
325327
this._stats = {
@@ -502,7 +504,7 @@ export class GitCommit implements GitRevisionReference {
502504

503505
let result = fileStats.join(separator);
504506
if (style === 'stats' && options?.color) {
505-
result = /*html*/ `<span style="background-color:var(--vscode-textCodeBlock-background);border-radius:3px;">&nbsp;${result}&nbsp;&nbsp;</span>`;
507+
result = /*html*/ `<span style="background-color:var(--vscode-textCodeBlock-background);border-radius:3px;">&nbsp;${result}&nbsp;&nbsp;</span> `;
506508
}
507509
if (options?.addParenthesesToFileStats) {
508510
result = `(${result})`;

0 commit comments

Comments
 (0)