@@ -41,19 +41,21 @@ const mailmap = new CaseIndifferentMap();
4141 let match ;
4242 // Replaced Name <[email protected] > 4343 if ( match = line . match ( / ^ ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) $ / ) ) {
44- mailmap . set ( match [ 2 ] , { author : match [ 1 ] } ) ;
44+ mailmap . set ( match [ 2 ] . toLowerCase ( ) , {
45+ author : match [ 1 ] , email : match [ 2 ]
46+ } ) ;
45474648 } else if ( match = line . match ( / ^ < ( [ ^ > ] + ) > \s + ( < [ ^ > ] + > ) $ / ) ) {
47- mailmap . set ( match [ 2 ] , { email : match [ 1 ] } ) ;
49+ mailmap . set ( match [ 2 ] . toLowerCase ( ) , { email : match [ 1 ] } ) ;
48504951 } else if ( match = line . match ( / ^ ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) \s + ( < [ ^ > ] + > ) $ / ) ) {
50- mailmap . set ( match [ 3 ] , {
52+ mailmap . set ( match [ 3 ] . toLowerCase ( ) , {
5153 author : match [ 1 ] , email : match [ 2 ]
5254 } ) ;
5355 // Replaced Name <[email protected] > Original Name <[email protected] > 5456 } else if ( match =
5557 line . match ( / ^ ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) \s + ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) $ / ) ) {
56- mailmap . set ( match [ 3 ] + '\0' + match [ 4 ] , {
58+ mailmap . set ( match [ 3 ] + '\0' + match [ 4 ] . toLowerCase ( ) , {
5759 author : match [ 1 ] , email : match [ 2 ]
5860 } ) ;
5961 } else {
@@ -75,8 +77,10 @@ rl.on('line', (line) => {
7577 if ( ! match ) return ;
7678
7779 let { author, email } = match . groups ;
80+ const emailLower = email . toLowerCase ( ) ;
7881
79- const replacement = mailmap . get ( author + '\0' + email ) || mailmap . get ( email ) ;
82+ const replacement =
83+ mailmap . get ( author + '\0' + emailLower ) || mailmap . get ( emailLower ) ;
8084 if ( replacement ) {
8185 ( { author, email } = { author, email, ...replacement } ) ;
8286 }
0 commit comments