소스 검색

Adds upstream to Commits view tracking node

main
Eric Amodio 4 년 전
부모
커밋
aa2c41be4f
1개의 변경된 파일12개의 추가작업 그리고 11개의 파일을 삭제
  1. +12
    -11
      src/views/nodes/branchTrackingStatusNode.ts

+ 12
- 11
src/views/nodes/branchTrackingStatusNode.ts 파일 보기

@ -9,7 +9,7 @@ import { GitBranch, GitLog, GitRevision, GitTrackingState } from '../../git/git'
import { GitUri } from '../../git/gitUri';
import { insertDateMarkers } from './helpers';
import { RepositoriesView } from '../repositoriesView';
import { debug, gate, Iterables, Strings } from '../../system';
import { debug, gate, Iterables, memoize, Strings } from '../../system';
import { ViewsWithFiles } from '../viewBase';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
@ -97,12 +97,7 @@ export class BranchTrackingStatusNode extends ViewNode implement
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
}
if (
!(this.view instanceof RepositoriesView) &&
this.status.upstream &&
this.ahead &&
this.status.state.ahead > 0
) {
if (!this.isReposView && this.status.upstream && this.ahead && this.status.state.ahead > 0) {
children.push(
new BranchTrackingStatusFilesNode(
this.view,
@ -120,15 +115,16 @@ export class BranchTrackingStatusNode extends ViewNode implement
getTreeItem(): TreeItem {
const ahead = this.ahead;
const label = ahead
let label = ahead
? `${Strings.pluralize('commit', this.status.state.ahead)} ahead`
: `${Strings.pluralize('commit', this.status.state.behind)} behind`;
if (!this.isReposView) {
label += `${ahead ? ' of ' : ' '}${this.status.upstream}`;
}
const item = new TreeItem(
label,
ahead && !(this.view instanceof RepositoriesView)
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed,
ahead && !this.isReposView ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
if (this.root) {
@ -143,6 +139,11 @@ export class BranchTrackingStatusNode extends ViewNode implement
return item;
}
@memoize()
private get isReposView() {
return this.view instanceof RepositoriesView;
}
@gate()
@debug()
refresh(reset?: boolean) {

불러오는 중...
취소
저장