Browse Source

Fixes non-current branch unpublish tracking

main
Eric Amodio 4 years ago
parent
commit
398d728193
1 changed files with 7 additions and 9 deletions
  1. +7
    -9
      src/views/nodes/branchNode.ts

+ 7
- 9
src/views/nodes/branchNode.ts View File

@ -114,13 +114,19 @@ export class BranchNode
if (this._children == null) { if (this._children == null) {
const children = []; const children = [];
const [log, pr] = await Promise.all([
const [log, pr, unpublished] = await Promise.all([
this.getLog(), this.getLog(),
this.view.config.pullRequests.enabled && this.view.config.pullRequests.enabled &&
this.view.config.pullRequests.showForBranches && this.view.config.pullRequests.showForBranches &&
(this.branch.tracking || this.branch.remote) (this.branch.tracking || this.branch.remote)
? this.branch.getAssociatedPullRequest(this.root ? { include: [PullRequestState.Open] } : undefined) ? this.branch.getAssociatedPullRequest(this.root ? { include: [PullRequestState.Open] } : undefined)
: undefined, : undefined,
this.branch.state.ahead > 0
? Container.git.getLog(this.uri.repoPath!, {
limit: 0,
ref: GitRevision.createRange(this.branch.tracking, this.branch.ref),
})
: undefined,
]); ]);
if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')]; if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')];
@ -171,14 +177,6 @@ export class BranchNode
children.push(new MessageNode(this.view, this, '', GlyphChars.Dash.repeat(2), '')); children.push(new MessageNode(this.view, this, '', GlyphChars.Dash.repeat(2), ''));
} }
let unpublished: GitLog | undefined;
if (this.branch.state.ahead > 0) {
unpublished = await Container.git.getLog(this.uri.repoPath!, {
limit: 0,
ref: GitRevision.createRange(this.branch.tracking, 'HEAD'),
});
}
const getBranchAndTagTips = await Container.git.getBranchesAndTagsTipsFn( const getBranchAndTagTips = await Container.git.getBranchesAndTagsTipsFn(
this.uri.repoPath, this.uri.repoPath,
this.branch.name, this.branch.name,

Loading…
Cancel
Save