@@ -117,13 +117,15 @@ pub fn traverse_commit_graph(repo: &gix::Repository, options: &CliOptions) -> Re
117
117
Ok ( git_metrics)
118
118
}
119
119
120
+ type NumberOfCommitsBySignature = HashMap < Sig , usize > ;
121
+
120
122
fn get_author_channel (
121
123
repo : & gix:: Repository ,
122
124
num_threads : usize ,
123
125
bot_regex_pattern : & Option < MyRegex > ,
124
126
mailmap : & gix:: mailmap:: Snapshot ,
125
127
) -> (
126
- Vec < JoinHandle < Result < HashMap < Sig , usize > > > > ,
128
+ Vec < JoinHandle < Result < NumberOfCommitsBySignature > > > ,
127
129
crossbeam_channel:: Sender < ObjectId > ,
128
130
) {
129
131
// we intentionally over-allocate threads a little as the main thread won't be very busy anyway
@@ -140,7 +142,7 @@ fn get_author_channel(
140
142
let bot_regex_pattern = bot_regex_pattern. clone ( ) ;
141
143
let rx = rx. clone ( ) ;
142
144
move || -> anyhow:: Result < _ > {
143
- let mut number_of_commits_by_signature: HashMap < Sig , usize > = HashMap :: new ( ) ;
145
+ let mut number_of_commits_by_signature = NumberOfCommitsBySignature :: new ( ) ;
144
146
// We are sure to see each object only once.
145
147
repo. object_cache_size ( 0 ) ;
146
148
while let Ok ( commit_id) = rx. recv ( ) {
@@ -160,22 +162,22 @@ fn get_author_channel(
160
162
( threads, tx)
161
163
}
162
164
165
+ type NumberOfCommitsByFilepath = HashMap < BString , usize > ;
166
+ type ChurnPair = ( NumberOfCommitsByFilepath , usize ) ;
167
+
163
168
fn get_churn_channel (
164
169
repo : & gix:: Repository ,
165
170
has_commit_graph_traversal_ended : & Arc < AtomicBool > ,
166
171
total_number_of_commits : & Arc < AtomicUsize > ,
167
172
churn_pool_size_opt : Option < usize > ,
168
- ) -> Result < (
169
- JoinHandle < Result < ( HashMap < BString , usize > , usize ) > > ,
170
- Sender < ObjectId > ,
171
- ) > {
173
+ ) -> Result < ( JoinHandle < Result < ChurnPair > > , Sender < ObjectId > ) > {
172
174
let ( tx, rx) = channel :: < gix:: hash:: ObjectId > ( ) ;
173
175
let thread = std:: thread:: spawn ( {
174
176
let repo = repo. clone ( ) ;
175
177
let has_commit_graph_traversal_ended = has_commit_graph_traversal_ended. clone ( ) ;
176
178
let total_number_of_commits = total_number_of_commits. clone ( ) ;
177
179
move || -> Result < _ > {
178
- let mut number_of_commits_by_file_path: HashMap < BString , usize > = HashMap :: new ( ) ;
180
+ let mut number_of_commits_by_file_path = NumberOfCommitsByFilepath :: new ( ) ;
179
181
let mut number_of_diffs_computed = 0 ;
180
182
while let Ok ( commit_id) = rx. recv ( ) {
181
183
let commit = repo. find_object ( commit_id) ?. into_commit ( ) ;
0 commit comments