From a286ef456b69c6907091cd86b1ec5751bf36b3cf Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Thu, 23 Jul 2020 02:13:17 -0400 Subject: [PATCH] Ensures branch & tag nodes have appropriate uris Fixes issues with Browse Repository from * commands --- src/views/nodes/branchesNode.ts | 4 +++- src/views/nodes/remoteNode.ts | 4 +++- src/views/nodes/tagsNode.ts | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/nodes/branchesNode.ts b/src/views/nodes/branchesNode.ts index 924bb93..f1c377d 100644 --- a/src/views/nodes/branchesNode.ts +++ b/src/views/nodes/branchesNode.ts @@ -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( diff --git a/src/views/nodes/remoteNode.ts b/src/views/nodes/remoteNode.ts index d65e5aa..4b5a9cc 100644 --- a/src/views/nodes/remoteNode.ts +++ b/src/views/nodes/remoteNode.ts @@ -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( diff --git a/src/views/nodes/tagsNode.ts b/src/views/nodes/tagsNode.ts index 9ab72dc..a962077 100644 --- a/src/views/nodes/tagsNode.ts +++ b/src/views/nodes/tagsNode.ts @@ -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(