@@ -9,6 +9,7 @@ import { GitFileIndexStatus } from '../models/fileStatus';
99import { uncommitted } from '../models/revision' ;
1010import type { GitUser } from '../models/user' ;
1111import { isUncommitted } from '../utils/revision.utils' ;
12+ import { isUserMatch } from '../utils/user.utils' ;
1213
1314interface BlameEntry {
1415 sha : string ;
@@ -202,20 +203,12 @@ function parseBlameEntry(
202203 commits : Map < string , GitCommit > ,
203204 authors : Map < string , GitBlameAuthor > ,
204205 lines : GitCommitLine [ ] ,
205- currentUser : { name ?: string ; email ?: string } | undefined ,
206+ currentUser : GitUser | undefined ,
206207) {
207208 let commit = commits . get ( entry . sha ) ;
208209 if ( commit == null ) {
209210 if ( entry . author != null ) {
210- if (
211- currentUser != null &&
212- // Name or e-mail is configured
213- ( currentUser . name != null || currentUser . email != null ) &&
214- // Match on name if configured
215- ( currentUser . name == null || currentUser . name === entry . author ) &&
216- // Match on email if configured
217- ( currentUser . email == null || currentUser . email === entry . authorEmail )
218- ) {
211+ if ( isUserMatch ( currentUser , entry . author , entry . authorEmail ) ) {
219212 entry . author = 'You' ;
220213 }
221214
@@ -229,6 +222,10 @@ function parseBlameEntry(
229222 }
230223 }
231224
225+ if ( entry . committer != null && isUserMatch ( currentUser , entry . committer , entry . committerEmail ) ) {
226+ entry . committer = 'You' ;
227+ }
228+
232229 commit = new GitCommit (
233230 container ,
234231 repoPath ,
0 commit comments