Browse Source

Ensures branch & tag nodes have appropriate uris

Fixes issues with Browse Repository from * commands
main
Eric Amodio 4 years ago
parent
commit
a286ef456b
3 changed files with 7 additions and 3 deletions
  1. +3
    -1
      src/views/nodes/branchesNode.ts
  2. +3
    -1
      src/views/nodes/remoteNode.ts
  3. +1
    -1
      src/views/nodes/tagsNode.ts

+ 3
- 1
src/views/nodes/branchesNode.ts View File

@ -37,7 +37,9 @@ export class BranchesNode extends ViewNode {
});
if (branches.length === 0) return [new MessageNode(this.view, this, 'No branches could be found.')];
const branchNodes = branches.map(b => new BranchNode(this.uri, this.view, this, b));
const branchNodes = branches.map(
b => new BranchNode(GitUri.fromRepoPath(this.uri.repoPath!, b.ref), this.view, this, b),
);
if (this.view.config.branches.layout === ViewBranchesLayout.List) return branchNodes;
const hierarchy = Arrays.makeHierarchical(

+ 3
- 1
src/views/nodes/remoteNode.ts View File

@ -45,7 +45,9 @@ export class RemoteNode extends ViewNode {
});
if (branches.length === 0) return [new MessageNode(this.view, this, 'No branches could be found.')];
const branchNodes = branches.map(b => new BranchNode(this.uri, this.view, this, b));
const branchNodes = branches.map(
b => new BranchNode(GitUri.fromRepoPath(this.uri.repoPath!, b.ref), this.view, this, b),
);
if (this.view.config.branches.layout === ViewBranchesLayout.List) return branchNodes;
const hierarchy = Arrays.makeHierarchical(

+ 1
- 1
src/views/nodes/tagsNode.ts View File

@ -29,7 +29,7 @@ export class TagsNode extends ViewNode {
const tags = await this.repo.getTags({ sort: true });
if (tags.length === 0) return [new MessageNode(this.view, this, 'No tags could be found.')];
const tagNodes = tags.map(t => new TagNode(this.uri, this.view, this, t));
const tagNodes = tags.map(t => new TagNode(GitUri.fromRepoPath(this.uri.repoPath!, t.ref), this.view, this, t));
if (this.view.config.branches.layout === ViewBranchesLayout.List) return tagNodes;
const hierarchy = Arrays.makeHierarchical(

Loading…
Cancel
Save