Ver código fonte

Fixes issues with branch status node commands

main
Eric Amodio 5 anos atrás
pai
commit
aa5b346b69
7 arquivos alterados com 13 adições e 12 exclusões
  1. +1
    -1
      package.json
  2. +2
    -2
      src/views/nodes/branchNode.ts
  3. +4
    -3
      src/views/nodes/branchTrackingStatusNode.ts
  4. +1
    -1
      src/views/nodes/commitNode.ts
  5. +1
    -1
      src/views/nodes/compareBranchNode.ts
  6. +2
    -2
      src/views/nodes/repositoryNode.ts
  7. +2
    -2
      src/views/nodes/viewNode.ts

+ 1
- 1
package.json Ver arquivo

@ -4965,7 +4965,7 @@
},
{
"command": "gitlens.views.expandNode",
"when": "viewItem =~ /gitlens:(compare|folder|results|search|status:files)\\b/",
"when": "viewItem =~ /gitlens:(compare|folder|results|search|status)\\b/",
"group": "8_gitlens@1"
},
{

+ 2
- 2
src/views/nodes/branchNode.ts Ver arquivo

@ -69,11 +69,11 @@ export class BranchNode extends ViewRefNode implements Pageabl
};
if (this.branch.state.behind) {
children.push(new BranchTrackingStatusNode(this.view, this, status, 'behind'));
children.push(new BranchTrackingStatusNode(this.view, this, this.branch, status, 'behind'));
}
if (this.branch.state.ahead) {
children.push(new BranchTrackingStatusNode(this.view, this, status, 'ahead'));
children.push(new BranchTrackingStatusNode(this.view, this, this.branch, status, 'ahead'));
}
}

+ 4
- 3
src/views/nodes/branchTrackingStatusNode.ts Ver arquivo

@ -1,7 +1,7 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Container } from '../../container';
import { GitTrackingState, GitUri } from '../../git/gitService';
import { GitBranch, GitTrackingState, GitUri } from '../../git/gitService';
import { Iterables, Strings } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
@ -24,6 +24,7 @@ export class BranchTrackingStatusNode extends ViewNode implements
constructor(
view: ViewWithFiles,
parent: ViewNode,
public readonly branch: GitBranch,
public readonly status: BranchTrackingStatus,
public readonly direction: 'ahead' | 'behind',
// Specifies that the node is shown as a root under the repository node
@ -62,12 +63,12 @@ export class BranchTrackingStatusNode extends ViewNode implements
}
}
children = [...insertDateMarkers(Iterables.map(commits, c => new CommitNode(this.view, this, c)), this, 1)];
children = [...insertDateMarkers(Iterables.map(commits, c => new CommitNode(this.view, this, c, this.branch)), this, 1)];
}
else {
children = [
...insertDateMarkers(
Iterables.map(log.commits.values(), c => new CommitNode(this.view, this, c)),
Iterables.map(log.commits.values(), c => new CommitNode(this.view, this, c, this.branch)),
this,
1
)

+ 1
- 1
src/views/nodes/commitNode.ts Ver arquivo

@ -65,7 +65,7 @@ export class CommitNode extends ViewRefNode {
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
item.contextValue = ResourceType.Commit;
if (this.branch === undefined || this.branch.current) {
if (this.branch !== undefined && this.branch.current) {
item.contextValue += '+current';
}
item.description = CommitFormatter.fromTemplate(this.view.config.commitDescriptionFormat, this.commit, {

+ 1
- 1
src/views/nodes/compareBranchNode.ts Ver arquivo

@ -33,7 +33,7 @@ export class CompareBranchNode extends ViewNode {
}
get id(): string {
return `gitlens:repository(${this.branch.repoPath}):branch(${this.branch.name}):compareWith`;
return `gitlens:repository(${this.branch.repoPath}):compare:branch(${this.branch.name}):compareWith`;
}
getChildren(): ViewNode[] {

+ 2
- 2
src/views/nodes/repositoryNode.ts Ver arquivo

@ -63,11 +63,11 @@ export class RepositoryNode extends SubscribeableViewNode {
children.push(new BranchNode(this.uri, this.view, this, branch, true));
if (status.state.behind) {
children.push(new BranchTrackingStatusNode(this.view, this, status, 'behind', true));
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'behind', true));
}
if (status.state.ahead) {
children.push(new BranchTrackingStatusNode(this.view, this, status, 'ahead', true));
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'ahead', true));
}
if (status.state.ahead || (status.files.length !== 0 && this.includeWorkingTree)) {

+ 2
- 2
src/views/nodes/viewNode.ts Ver arquivo

@ -10,8 +10,8 @@ export enum ResourceType {
ActiveLineHistory = 'gitlens:history:active:line',
Branch = 'gitlens:branch',
Branches = 'gitlens:branches',
BranchStatusAheadOfUpstream = 'gitlens:branch-status:upstream:ahead',
BranchStatusBehindUpstream = 'gitlens:branch-status:upstream:behind',
BranchStatusAheadOfUpstream = 'gitlens:status-branch:upstream:ahead',
BranchStatusBehindUpstream = 'gitlens:status-branch:upstream:behind',
Commit = 'gitlens:commit',
Commits = 'gitlens:commits',
Compare = 'gitlens:compare',

Carregando…
Cancelar
Salvar