@@ -41,19 +41,21 @@ const mailmap = new CaseIndifferentMap();
4141let match ;
4242// Replaced Name <original@example.com>
4343if ( 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+ } ) ;
4547// <replaced@example.com> <original@example.com>
4648} else if ( match = line . match ( / ^ < ( [ ^ > ] + ) > \s + ( < [ ^ > ] + > ) $ / ) ) {
47- mailmap . set ( match [ 2 ] , { email : match [ 1 ] } ) ;
49+ mailmap . set ( match [ 2 ] . toLowerCase ( ) , { email : match [ 1 ] } ) ;
4850// Replaced Name <replaced@example.com> <original@example.com>
4951} else if ( match = line . match ( / ^ ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) \s + ( < [ ^ > ] + > ) $ / ) ) {
50- mailmap . set ( match [ 3 ] , {
52+ mailmap . set ( match [ 3 ] . toLowerCase ( ) , {
5153author : match [ 1 ] , email : match [ 2 ]
5254} ) ;
5355// Replaced Name <replaced@example.com> Original Name <original@example.com>
5456} else if ( match =
5557line . match ( / ^ ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) \s + ( [ ^ < ] + ) \s + ( < [ ^ > ] + > ) $ / ) ) {
56- mailmap . set ( match [ 3 ] + '\0' + match [ 4 ] , {
58+ mailmap . set ( match [ 3 ] + '\0' + match [ 4 ] . toLowerCase ( ) , {
5759author : match [ 1 ] , email : match [ 2 ]
5860} ) ;
5961} else {
@@ -75,8 +77,10 @@ rl.on('line', (line) => {
7577if ( ! match ) return ;
7678
7779let { 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 ) ;
8084if ( replacement ) {
8185( { author, email } = { author, email, ...replacement } ) ;
8286}
0 commit comments