@@ -275,27 +275,32 @@ func mailmapLookup(authors []string) []string {
275
275
}
276
276
277
277
func writeAuthors (files []string ) {
278
- merge := make (map [string ]bool )
278
+ var (
279
+ dedup = make (map [string ]bool )
280
+ list []string
281
+ )
279
282
// Add authors that Git reports as contributors.
280
283
// This is the primary source of author information.
281
284
for _ , a := range gitAuthors (files ) {
282
- merge [a ] = true
285
+ if la := strings .ToLower (a ); ! dedup [la ] {
286
+ list = append (list , a )
287
+ dedup [la ] = true
288
+ }
283
289
}
284
290
// Add existing authors from the file. This should ensure that we
285
291
// never lose authors, even if Git stops listing them. We can also
286
292
// add authors manually this way.
287
293
for _ , a := range readAuthors () {
288
- merge [a ] = true
294
+ if la := strings .ToLower (a ); ! dedup [la ] {
295
+ list = append (list , a )
296
+ dedup [la ] = true
297
+ }
289
298
}
290
299
// Write sorted list of authors back to the file.
291
- var result []string
292
- for a := range merge {
293
- result = append (result , a )
294
- }
295
- sort .Sort (authors (result ))
300
+ sort .Sort (authors (list ))
296
301
content := new (bytes.Buffer )
297
302
content .WriteString (authorsFileHeader )
298
- for _ , a := range result {
303
+ for _ , a := range list {
299
304
content .WriteString (a )
300
305
content .WriteString ("\n " )
301
306
}
0 commit comments