Skip to content

Commit 0706b42

Browse files
committed
fixes #14659
1 parent 1d2d5e0 commit 0706b42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vs/workbench/parts/git/common/gitModel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { EventEmitter } from 'vs/base/common/eventEmitter';
1010
import {
1111
IStatusModel, IStatusSummary, IRawFileStatus, ModelEvents,
1212
IFileStatus, IStatusGroup, Status, StatusType,
13-
IBranch, IRef, IRemote, IModel, IRawStatus
13+
IBranch, IRef, IRemote, IModel, IRawStatus, RefType
1414
} from 'vs/workbench/parts/git/common/git';
1515

1616
export class FileStatus implements IFileStatus {
@@ -389,9 +389,9 @@ export class Model extends EventEmitter implements IModel {
389389
return '';
390390
}
391391

392-
const ref = this.getRefs().filter(iref => iref.commit === this.HEAD.commit)[0];
393-
const refName = ref && ref.name;
394-
const head = refName || this.HEAD.name || this.HEAD.commit.substr(0, 8);
392+
const tag = this.getRefs().filter(iref => iref.type === RefType.Tag && iref.commit === this.HEAD.commit)[0];
393+
const tagName = tag && tag.name;
394+
const head = this.HEAD.name || tagName || this.HEAD.commit.substr(0, 8);
395395

396396
const statusSummary = this.getStatus().getSummary();
397397

0 commit comments

Comments
 (0)