@@ -32,6 +32,7 @@ import {
32
32
ReviewState ,
33
33
} from './interface' ;
34
34
import { IssueOverviewPanel } from './issueOverview' ;
35
+ import { PullRequestGitHelper } from './pullRequestGitHelper' ;
35
36
import { PullRequestModel } from './pullRequestModel' ;
36
37
import { PullRequestView } from './pullRequestOverviewCommon' ;
37
38
import { getAssigneesQuickPickItems , getMilestoneFromQuickPick , getProjectFromQuickPick , pickEmail , reviewersQuickPick } from './quickPicks' ;
@@ -209,7 +210,9 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
209
210
this . _folderRepositoryManager . mergeQueueMethodForBranch ( pullRequestModel . base . ref , pullRequestModel . remote . owner , pullRequestModel . remote . repositoryName ) ,
210
211
this . _folderRepositoryManager . isHeadUpToDateWithBase ( pullRequestModel ) ,
211
212
pullRequestModel . getMergeability ( ) ,
212
- this . _folderRepositoryManager . credentialStore . getIsEmu ( pullRequestModel . remote . authProviderId ) ] )
213
+ this . _folderRepositoryManager . credentialStore . getIsEmu ( pullRequestModel . remote . authProviderId ) ,
214
+ pullRequestModel . githubRepository . getAuthenticatedUserEmails ( ) ,
215
+ PullRequestGitHelper . getEmail ( this . _folderRepositoryManager . repository ) ] )
213
216
. then ( result => {
214
217
const [
215
218
pullRequest ,
@@ -225,7 +228,9 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
225
228
mergeQueueMethod ,
226
229
isBranchUpToDateWithBase ,
227
230
mergeability ,
228
- isEmu
231
+ isEmu ,
232
+ gitHubEmails ,
233
+ gitEmail
229
234
] = result ;
230
235
if ( ! pullRequest ) {
231
236
throw new Error (
@@ -255,6 +260,8 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
255
260
const isUpdateBranchWithGitHubEnabled : boolean = this . isUpdateBranchWithGitHubEnabled ( ) ;
256
261
const continueOnGitHub = isCrossRepository && isInCodespaces ( ) ;
257
262
const reviewState = this . getCurrentUserReviewState ( this . _existingReviewers , currentUser ) ;
263
+ const emailForCommit = isEmu ? undefined : ( ( gitEmail && gitHubEmails . find ( email => email . toLowerCase ( ) === gitEmail . toLowerCase ( ) ) ) ?? currentUser . email ) ;
264
+
258
265
Logger . debug ( 'pr.initialize' , PullRequestOverviewPanel . ID ) ;
259
266
const context : Partial < PullRequest > = {
260
267
number : pullRequest . number ,
@@ -304,7 +311,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
304
311
milestone : pullRequest . milestone ,
305
312
assignees : pullRequest . assignees ,
306
313
continueOnGitHub,
307
- emailForCommit : isEmu ? undefined : currentUser . email ,
314
+ emailForCommit,
308
315
isAuthor : currentUser . login === pullRequest . author . login ,
309
316
currentUserReviewState : reviewState ,
310
317
isDarkTheme : vscode . window . activeColorTheme . kind === vscode . ColorThemeKind . Dark ,
0 commit comments