diff --git a/package.json b/package.json index 91d72ea..ab89934 100644 --- a/package.json +++ b/package.json @@ -8437,9 +8437,25 @@ "group": "1_gitlens_actions@3" }, { + "command": "gitlens.views.createBranch", + "when": "!gitlens:readonly && viewItem =~ /gitlens:status:upstream/", + "group": "1_gitlens_secondary_actions@1" + }, + { + "command": "gitlens.views.createTag", + "when": "!gitlens:readonly && viewItem =~ /gitlens:status:upstream/", + "group": "1_gitlens_secondary_actions@2" + }, + { "command": "gitlens.views.createPullRequest", "when": "gitlens:action:createPullRequest && viewItem =~ /gitlens:status:upstream:(?!none)/", - "group": "1_gitlens_actions@4" + "group": "1_gitlens_secondary_actions@3" + }, + { + "command": "gitlens.openBranchOnRemote", + "when": "gitlens:hasRemotes && !gitlens:readonly && viewItem =~ /gitlens:status:upstream:(?!none)/", + "group": "2_gitlens_quickopen@1", + "alt": "gitlens.copyRemoteBranchUrl" }, { "command": "gitlens.views.dismissNode", diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index f7aae07..3feb883 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -280,8 +280,13 @@ export class ViewCommands { } @debug() - private async createBranch(node?: ViewRefNode | BranchesNode) { - let from = node instanceof ViewRefNode ? node?.ref : undefined; + private async createBranch(node?: ViewRefNode | BranchesNode | BranchTrackingStatusNode) { + let from = + node instanceof ViewRefNode + ? node?.ref + : node instanceof BranchTrackingStatusNode + ? node.branch + : undefined; if (from == null) { const branch = await Container.git.getBranch(node?.repoPath ?? (await Container.git.getActiveRepoPath())); from = branch; @@ -323,8 +328,18 @@ export class ViewCommands { } @debug() - private createTag(node?: ViewRefNode | TagsNode) { - return GitActions.Tag.create(node?.repoPath, node instanceof ViewRefNode ? node?.ref : undefined); + private async createTag(node?: ViewRefNode | TagsNode | BranchTrackingStatusNode) { + let from = + node instanceof ViewRefNode + ? node?.ref + : node instanceof BranchTrackingStatusNode + ? node.branch + : undefined; + if (from == null) { + const branch = await Container.git.getBranch(node?.repoPath ?? (await Container.git.getActiveRepoPath())); + from = branch; + } + return GitActions.Tag.create(node?.repoPath, from); } @debug()