@@ -9,6 +9,7 @@ import type { ContextKeys } from '../../constants.context';
9
9
import type { HomeTelemetryContext } from '../../constants.telemetry' ;
10
10
import type { Container } from '../../container' ;
11
11
import { executeGitCommand } from '../../git/actions' ;
12
+ import { openComparisonChanges } from '../../git/actions/commit' ;
12
13
import * as RepoActions from '../../git/actions/repository' ;
13
14
import type { BranchContributorOverview } from '../../git/gitProvider' ;
14
15
import type { GitBranch } from '../../git/models/branch' ;
@@ -266,6 +267,7 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
266
267
( ) => this . container . subscription . validate ( { force : true } ) ,
267
268
this ,
268
269
) ,
270
+ registerCommand ( 'gitlens.home.openPullRequestChanges' , this . pullRequestChanges , this ) ,
269
271
registerCommand ( 'gitlens.home.openPullRequestComparison' , this . pullRequestCompare , this ) ,
270
272
registerCommand ( 'gitlens.home.openPullRequestOnRemote' , this . pullRequestViewOnRemote , this ) ,
271
273
registerCommand ( 'gitlens.home.createPullRequest' , this . pullRequestCreate , this ) ,
@@ -773,11 +775,27 @@ export class HomeWebviewProvider implements WebviewProvider<State, State, HomeWe
773
775
if ( pr ?. refs ?. base == null || pr . refs . head == null ) return ;
774
776
775
777
const comparisonRefs = getComparisonRefsForPullRequest ( refs . repoPath , pr . refs ) ;
776
- return this . container . views . searchAndCompare
777
- . compare ( comparisonRefs . repoPath , comparisonRefs . head , comparisonRefs . base )
778
- . then ( compareNode => {
779
- executeCommand ( Commands . ViewsOpenAllChangedFileDiffs , compareNode ) ;
780
- } ) ;
778
+ return this . container . views . searchAndCompare . compare (
779
+ comparisonRefs . repoPath ,
780
+ comparisonRefs . head ,
781
+ comparisonRefs . base ,
782
+ ) ;
783
+ }
784
+
785
+ private async pullRequestChanges ( refs : BranchRef ) {
786
+ const pr = await this . findPullRequest ( refs ) ;
787
+ if ( pr ?. refs ?. base == null || pr . refs . head == null ) return ;
788
+
789
+ const comparisonRefs = getComparisonRefsForPullRequest ( refs . repoPath , pr . refs ) ;
790
+ return openComparisonChanges (
791
+ this . container ,
792
+ {
793
+ repoPath : comparisonRefs . repoPath ,
794
+ lhs : comparisonRefs . base . ref ,
795
+ rhs : comparisonRefs . head . ref ,
796
+ } ,
797
+ { title : `Changes in Pull Request #${ pr . id } ` } ,
798
+ ) ;
781
799
}
782
800
783
801
private async pullRequestViewOnRemote ( refs : BranchRef , clipboard ?: boolean ) {
0 commit comments