@@ -88,7 +88,7 @@ impl std::fmt::Display for Info {
88
88
iter. collect ( )
89
89
}
90
90
} ;
91
-
91
+
92
92
for ( cnt, language) in languages. iter ( ) . enumerate ( ) {
93
93
let formatted_number = format ! ( "{:.*}" , 2 , language. 1 ) ;
94
94
if cnt != 0 && cnt % 3 == 0 {
@@ -223,14 +223,15 @@ impl Info {
223
223
colors : Vec < String > ,
224
224
disabled : InfoFieldOn ,
225
225
bold_flag : bool ,
226
- custom_image : Option < DynamicImage >
226
+ custom_image : Option < DynamicImage > ,
227
+ no_merges : bool ,
227
228
) -> Result < Info > {
228
229
let authors = Info :: get_authors ( & dir, 3 ) ;
229
230
let ( git_v, git_user) = Info :: get_git_info ( & dir) ;
230
231
let current_commit_info = Info :: get_current_commit_info ( & dir) ?;
231
232
let config = Info :: get_configuration ( & dir) ?;
232
233
let version = Info :: get_version ( & dir) ?;
233
- let commits = Info :: get_commits ( & dir) ?;
234
+ let commits = Info :: get_commits ( & dir, no_merges ) ?;
234
235
let repo_size = Info :: get_packed_size ( & dir) ?;
235
236
let last_change = Info :: get_last_change ( & dir) ?;
236
237
let creation_date = Info :: get_creation_time ( dir) ?;
@@ -407,13 +408,15 @@ impl Info {
407
408
}
408
409
}
409
410
410
- fn get_commits ( dir : & str ) -> Result < String > {
411
+ fn get_commits ( dir : & str , no_merges : bool ) -> Result < String > {
412
+ let mut args = vec ! [ "-C" , dir, "rev-list" , "--count" ] ;
413
+ if no_merges {
414
+ args. push ( "--no-merges" ) ;
415
+ }
416
+ args. push ( "HEAD" ) ;
417
+
411
418
let output = Command :: new ( "git" )
412
- . arg ( "-C" )
413
- . arg ( dir)
414
- . arg ( "rev-list" )
415
- . arg ( "--count" )
416
- . arg ( "HEAD" )
419
+ . args ( args)
417
420
. output ( )
418
421
. expect ( "Failed to execute git." ) ;
419
422
0 commit comments