Skip to content

Commit 50beac7

Browse files
sergeibbbeamodio
authored andcommitted
Fixes commands to change or set branch upstream in graph
(#4498, #4539)
1 parent 984dd82 commit 50beac7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/webviews/plus/graph/graphWebview.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
526526
this.host.registerWebviewCommand('gitlens.graph.rebaseOntoUpstream', this.rebaseToRemote),
527527
this.host.registerWebviewCommand('gitlens.graph.renameBranch', this.renameBranch),
528528
this.host.registerWebviewCommand('gitlens.graph.associateIssueWithBranch', this.associateIssueWithBranch),
529+
this.host.registerWebviewCommand('gitlens.changeUpstream:graph', this.changeUpstreamBranch),
530+
this.host.registerWebviewCommand('gitlens.setUpstream:graph', this.changeUpstreamBranch),
529531

530532
this.host.registerWebviewCommand('gitlens.graph.switchToBranch', this.switchTo),
531533

@@ -3819,6 +3821,13 @@ export class GraphWebviewProvider implements WebviewProvider<State, State, Graph
38193821
return Promise.resolve();
38203822
}
38213823

3824+
@log()
3825+
private changeUpstreamBranch(item?: GraphItemContext) {
3826+
if (!isGraphItemRefContext(item, 'branch')) return Promise.resolve();
3827+
const { ref } = item.webviewItemValue;
3828+
return BranchActions.changeUpstream(ref.repoPath, ref);
3829+
}
3830+
38223831
@log()
38233832
private compareWorkingWith(item?: GraphItemContext) {
38243833
const ref = this.getGraphItemRef(item);

0 commit comments

Comments
 (0)