@@ -4,6 +4,7 @@ import { ActionRunnerType } from '../../api/actionRunners';
4
4
import type { CreatePullRequestActionContext } from '../../api/gitlens' ;
5
5
import type { EnrichedAutolink } from '../../autolinks/models/autolinks' ;
6
6
import { getAvatarUriFromGravatarEmail } from '../../avatars' ;
7
+ import type { ChangeBranchMergeTargetCommandArgs } from '../../commands/changeBranchMergeTarget' ;
7
8
import type { BranchGitCommandArgs } from '../../commands/git/branch' ;
8
9
import type { OpenPullRequestOnRemoteCommandArgs } from '../../commands/openPullRequestOnRemote' ;
9
10
import { GlyphChars , urls } from '../../constants' ;
@@ -333,6 +334,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
333
334
( src ?: Source ) => this . container . subscription . validate ( { force : true } , src ) ,
334
335
this ,
335
336
) ,
337
+ registerCommand ( 'gitlens.home.changeBranchMergeTarget' , this . changeBranchMergeTarget , this ) ,
336
338
registerCommand ( 'gitlens.home.deleteBranchOrWorktree' , this . deleteBranchOrWorktree , this ) ,
337
339
registerCommand ( 'gitlens.home.pushBranch' , this . pushBranch , this ) ,
338
340
registerCommand ( 'gitlens.home.openMergeTargetComparison' , this . mergeTargetCompare , this ) ,
@@ -490,6 +492,19 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
490
492
} ) ;
491
493
}
492
494
495
+ @log < HomeWebviewProvider [ 'changeBranchMergeTarget' ] > ( )
496
+ private changeBranchMergeTarget ( ref : BranchAndTargetRefs ) {
497
+ this . container . telemetry . sendEvent ( 'home/changeBranchMergeTarget' ) ;
498
+ void executeCommand < ChangeBranchMergeTargetCommandArgs > ( 'gitlens.changeBranchMergeTarget' , {
499
+ command : 'changeBranchMergeTarget' ,
500
+ state : {
501
+ repo : ref . repoPath ,
502
+ branch : ref . branchName ,
503
+ mergeBranch : ref . mergeTargetName ,
504
+ } ,
505
+ } ) ;
506
+ }
507
+
493
508
@log < HomeWebviewProvider [ 'mergeIntoCurrent' ] > ( { args : { 0 : r => r . branchId } } )
494
509
private async mergeIntoCurrent ( ref : BranchRef ) {
495
510
const { repo, branch } = await this . getRepoInfoFromRef ( ref ) ;
@@ -1682,7 +1697,9 @@ async function getBranchMergeTargetStatusInfo(
1682
1697
} ) ;
1683
1698
1684
1699
let targetResult ;
1685
- if ( ! info . targetBranch . paused && info . targetBranch . value ) {
1700
+ if ( info . userTargetBranch ) {
1701
+ targetResult = info . userTargetBranch ;
1702
+ } else if ( ! info . targetBranch . paused && info . targetBranch . value ) {
1686
1703
targetResult = info . targetBranch . value ;
1687
1704
}
1688
1705
0 commit comments