@@ -1206,22 +1206,27 @@ export class PullRequestModel extends IssueModel<PullRequest> implements IPullRe
12061206 return ;
12071207 }
12081208
1209- // Create URI pairs for the multi diff editor
1209+ // Create URI pairs for the multi diff editor using review scheme
12101210 const args : [ vscode . Uri , vscode . Uri | undefined , vscode . Uri | undefined ] [ ] = [ ] ;
12111211 for ( const change of changes ) {
1212- const workspaceUri = vscode . Uri . file ( path . resolve ( repository . rootUri . fsPath , change . uri . fsPath ) ) ;
1212+ const uri = vscode . Uri . file ( path . resolve ( repository . rootUri . fsPath , change . uri . fsPath ) ) ;
1213+ const fileName = change . uri . fsPath ;
12131214
12141215 if ( change . status === GitChangeType . ADD ) {
12151216 // For added files, show against empty
1216- args . push ( [ workspaceUri , undefined , workspaceUri ] ) ;
1217+ const headUri = toReviewUri ( uri , fileName , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1218+ args . push ( [ headUri , undefined , headUri ] ) ;
12171219 } else if ( change . status === GitChangeType . DELETE ) {
12181220 // For deleted files, show old version against empty
1219- const beforeUri = change . originalUri || change . uri ;
1220- args . push ( [ workspaceUri , beforeUri , undefined ] ) ;
1221+ const baseFileName = change . status === GitChangeType . RENAME ? change . previousFileName : fileName ;
1222+ const baseUri = toReviewUri ( uri , baseFileName , undefined , commitSha + '~1' , false , { base : true } , repository . rootUri ) ;
1223+ args . push ( [ uri , baseUri , undefined ] ) ;
12211224 } else {
12221225 // For modified files, show before and after
1223- const beforeUri = change . originalUri || change . uri ;
1224- args . push ( [ workspaceUri , beforeUri , workspaceUri ] ) ;
1226+ const baseFileName = change . status === GitChangeType . RENAME ? change . previousFileName : fileName ;
1227+ const baseUri = toReviewUri ( uri , baseFileName , undefined , commitSha + '~1' , false , { base : true } , repository . rootUri ) ;
1228+ const headUri = toReviewUri ( uri , fileName , undefined , commitSha , false , { base : false } , repository . rootUri ) ;
1229+ args . push ( [ headUri , baseUri , headUri ] ) ;
12251230 }
12261231 }
12271232
0 commit comments