File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -489,13 +489,13 @@ impl Info {
489
489
490
490
fn get_authors ( git_history : & [ String ] , n : usize ) -> Vec < ( String , usize , usize ) > {
491
491
let mut authors = std:: collections:: HashMap :: new ( ) ;
492
- let mut names = std:: collections:: HashMap :: new ( ) ;
492
+ let mut author_name_by_email = std:: collections:: HashMap :: new ( ) ;
493
493
let mut total_commits = 0 ;
494
494
for line in git_history {
495
- let commit_author = line. split ( '\t' ) . collect :: < Vec < _ > > ( ) [ 1 ] . to_string ( ) ;
495
+ let author_email = line. split ( '\t' ) . collect :: < Vec < _ > > ( ) [ 1 ] . to_string ( ) ;
496
496
let author_name = line. split ( '\t' ) . collect :: < Vec < _ > > ( ) [ 2 ] . to_string ( ) ;
497
- let commit_count = authors. entry ( commit_author . to_string ( ) ) . or_insert ( 0 ) ;
498
- names . entry ( commit_author . to_string ( ) ) . or_insert ( author_name) ;
497
+ let commit_count = authors. entry ( author_email . to_string ( ) ) . or_insert ( 0 ) ;
498
+ author_name_by_email . entry ( author_email . to_string ( ) ) . or_insert ( author_name) ;
499
499
* commit_count += 1 ;
500
500
total_commits += 1 ;
501
501
}
@@ -509,7 +509,7 @@ impl Info {
509
509
. into_iter ( )
510
510
. map ( |( author, count) | {
511
511
(
512
- names . get ( & author) . unwrap ( ) . trim_matches ( '\'' ) . to_string ( ) ,
512
+ author_name_by_email . get ( & author) . unwrap ( ) . trim_matches ( '\'' ) . to_string ( ) ,
513
513
count,
514
514
count * 100 / total_commits,
515
515
)
You can’t perform that action at this time.
0 commit comments