提交 0706b425 编写于 作者: J Joao Moreno

fixes #14659

上级 1d2d5e08
......@@ -10,7 +10,7 @@ import { EventEmitter } from 'vs/base/common/eventEmitter';
import {
IStatusModel, IStatusSummary, IRawFileStatus, ModelEvents,
IFileStatus, IStatusGroup, Status, StatusType,
IBranch, IRef, IRemote, IModel, IRawStatus
IBranch, IRef, IRemote, IModel, IRawStatus, RefType
} from 'vs/workbench/parts/git/common/git';
export class FileStatus implements IFileStatus {
......@@ -389,9 +389,9 @@ export class Model extends EventEmitter implements IModel {
return '';
}
const ref = this.getRefs().filter(iref => iref.commit === this.HEAD.commit)[0];
const refName = ref && ref.name;
const head = refName || this.HEAD.name || this.HEAD.commit.substr(0, 8);
const tag = this.getRefs().filter(iref => iref.type === RefType.Tag && iref.commit === this.HEAD.commit)[0];
const tagName = tag && tag.name;
const head = this.HEAD.name || tagName || this.HEAD.commit.substr(0, 8);
const statusSummary = this.getStatus().getSummary();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册