@@ -376,8 +376,11 @@ impl std::fmt::Display for Info {
376
376
impl Info {
377
377
#[ tokio:: main]
378
378
pub async fn new ( config : Options ) -> Result < Info > {
379
- let repo = Repository :: discover ( & config. path ) . chain_err ( ||"Could not find a valid git repo on the current path" ) ?;
380
- let workdir = repo. workdir ( ) . chain_err ( ||"Unable to run onefetch on bare git repo" ) ?;
379
+ let repo = Repository :: discover ( & config. path )
380
+ . chain_err ( || "Could not find a valid git repo on the current path" ) ?;
381
+ let workdir = repo
382
+ . workdir ( )
383
+ . chain_err ( || "Unable to run onefetch on bare git repo" ) ?;
381
384
let workdir_str = workdir. to_str ( ) . unwrap ( ) ;
382
385
let ( languages_stats, number_of_lines) =
383
386
Language :: get_language_stats ( workdir_str, & config. excluded ) ?;
@@ -485,7 +488,9 @@ impl Info {
485
488
}
486
489
487
490
async fn get_repo_name_and_url ( repo : & Repository ) -> ( String , String ) {
488
- let config = repo. config ( ) . chain_err ( || "Could not retrieve git configuration data" ) ;
491
+ let config = repo
492
+ . config ( )
493
+ . chain_err ( || "Could not retrieve git configuration data" ) ;
489
494
let mut remote_url = String :: new ( ) ;
490
495
let mut repository_name = String :: new ( ) ;
491
496
@@ -518,9 +523,15 @@ impl Info {
518
523
}
519
524
520
525
async fn get_current_commit_info ( repo : & Repository ) -> Result < CommitInfo > {
521
- let head = repo. head ( ) . chain_err ( || "Error while retrieving reference information" ) ?;
522
- let head_oid = head. target ( ) . ok_or ( "Error while retrieving reference information" ) ?;
523
- let refs = repo. references ( ) . chain_err ( || "Error while retrieving reference information" ) ?;
526
+ let head = repo
527
+ . head ( )
528
+ . chain_err ( || "Error while retrieving reference information" ) ?;
529
+ let head_oid = head
530
+ . target ( )
531
+ . ok_or ( "Error while retrieving reference information" ) ?;
532
+ let refs = repo
533
+ . references ( )
534
+ . chain_err ( || "Error while retrieving reference information" ) ?;
524
535
let refs_info = refs
525
536
. filter_map ( |reference| match reference {
526
537
Ok ( reference) => match ( reference. target ( ) , reference. shorthand ( ) ) {
0 commit comments