| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,19 +41,21 @@ const mailmap = new CaseIndifferentMap(); | |||
| 41 | 41 | let match; | |
| 42 | 42 | // Replaced Name <original@example.com> | |
| 43 | 43 | 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 | + }); | ||
| 45 | 47 | // <replaced@example.com> <original@example.com> | |
| 46 | 48 | } else if (match = line.match(/^<([^>]+)>\s+(<[^>]+>)$/)) { | |
| 47 | - mailmap.set(match[2], { email: match[1] }); | ||
| 49 | + mailmap.set(match[2].toLowerCase(), { email: match[1] }); | ||
| 48 | 50 | // Replaced Name <replaced@example.com> <original@example.com> | |
| 49 | 51 | } else if (match = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/)) { | |
| 50 | - mailmap.set(match[3], { | ||
| 52 | + mailmap.set(match[3].toLowerCase(), { | ||
| 51 | 53 | author: match[1], email: match[2] | |
| 52 | 54 | }); | |
| 53 | 55 | // Replaced Name <replaced@example.com> Original Name <original@example.com> | |
| 54 | 56 | } else if (match = | |
| 55 | 57 | line.match(/^([^<]+)\s+(<[^>]+>)\s+([^<]+)\s+(<[^>]+>)$/)) { | |
| 56 | - mailmap.set(match[3] + '\0' + match[4], { | ||
| 58 | + mailmap.set(match[3] + '\0' + match[4].toLowerCase(), { | ||
| 57 | 59 | author: match[1], email: match[2] | |
| 58 | 60 | }); | |
| 59 | 61 | } else { | |
@@ -75,8 +77,10 @@ rl.on('line', (line) => { | |||
| 75 | 77 | if (!match) return; | |
| 76 | 78 | ||
| 77 | 79 | let { author, email } = match.groups; | |
| 80 | + const emailLower = email.toLowerCase(); | ||
| 78 | 81 | ||
| 79 | - const replacement = mailmap.get(author + '\0' + email) || mailmap.get(email); | ||
| 82 | + const replacement = | ||
| 83 | + mailmap.get(author + '\0' + emailLower) || mailmap.get(emailLower); | ||
| 80 | 84 | if (replacement) { | |
| 81 | 85 | ({ author, email } = { author, email, ...replacement }); | |
| 82 | 86 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments