@@ -5,6 +5,7 @@ import type { CreatePullRequestActionContext } from '../../api/gitlens';
55import type { EnrichedAutolink } from '../../autolinks/models/autolinks' ;
66import { getAvatarUriFromGravatarEmail } from '../../avatars' ;
77import type { ChangeBranchMergeTargetCommandArgs } from '../../commands/changeBranchMergeTarget' ;
8+ import type { ExplainBranchCommandArgs } from '../../commands/explainBranch' ;
89import type { ExplainWipCommandArgs } from '../../commands/explainWip' ;
910import type { BranchGitCommandArgs } from '../../commands/git/branch' ;
1011import type { OpenPullRequestOnRemoteCommandArgs } from '../../commands/openPullRequestOnRemote' ;
@@ -358,7 +359,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
358359 registerCommand ( 'gitlens.home.abortPausedOperation' , this . abortPausedOperation , this ) ,
359360 registerCommand ( 'gitlens.home.openRebaseEditor' , this . openRebaseEditor , this ) ,
360361 registerCommand ( 'gitlens.ai.explainWip:home' , this . explainWip , this ) ,
361- registerCommand ( 'gitlens.ai.explainBranch:home' , this . explainWip , this ) ,
362+ registerCommand ( 'gitlens.ai.explainBranch:home' , this . explainBranch , this ) ,
362363 ] ;
363364 }
364365
@@ -550,6 +551,18 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
550551 void RepoActions . rebase ( repo , getReferenceFromBranch ( branch ) ) ;
551552 }
552553
554+ @log < HomeWebviewProvider [ 'explainBranch' ] > ( { args : { 0 : r => r . branchId } } )
555+ private async explainBranch ( ref : BranchRef ) {
556+ const { repo, branch } = await this . getRepoInfoFromRef ( ref ) ;
557+ if ( repo == null ) return ;
558+
559+ void executeCommand < ExplainBranchCommandArgs > ( 'gitlens.ai.explainBranch' , {
560+ repoPath : repo . path ,
561+ ref : branch ?. ref ,
562+ source : { source : 'home' , detail : 'branch' } ,
563+ } ) ;
564+ }
565+
553566 @log < HomeWebviewProvider [ 'explainWip' ] > ( { args : { 0 : r => r . branchId } } )
554567 private async explainWip ( ref : BranchRef ) {
555568 const { repo, branch } = await this . getRepoInfoFromRef ( ref ) ;
0 commit comments