File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,20 @@ impl<'a> Repo<'a> {
106
106
. take ( number_of_authors_to_display)
107
107
. collect ( ) ;
108
108
109
+ // This could happen if a branch pointed to non-commit object, so no traversal actually happens.
110
+ let ( time_of_first_commit, time_of_most_recent_commit) = time_of_first_commit
111
+ . and_then ( |a| time_of_most_recent_commit. map ( |b| ( a, b) ) )
112
+ . unwrap_or_default ( ) ;
113
+
109
114
drop ( commit_iter) ;
110
115
Ok ( Self {
111
116
repo,
112
117
git2_repo,
113
118
authors,
114
119
total_num_authors,
115
120
num_commits,
116
- time_of_first_commit : time_of_first_commit . expect ( "at least one commit" ) ,
117
- time_of_most_recent_commit : time_of_most_recent_commit . expect ( "at least one commit" ) ,
121
+ time_of_first_commit,
122
+ time_of_most_recent_commit,
118
123
} )
119
124
}
120
125
You can’t perform that action at this time.
0 commit comments