File tree 1 file changed +21
-21
lines changed
1 file changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -204,29 +204,29 @@ where
204
204
if entry_mode. is_no_tree ( ) {
205
205
files. modified += 1 ;
206
206
}
207
- if line_stats {
208
- if let Some ( Ok ( diff) ) = change. event . diff ( ) {
209
- use git:: diff:: lines:: similar:: ChangeTag :: * ;
210
- let mut nl = 0 ;
211
- for change in diff
212
- . text ( git:: diff:: lines:: Algorithm :: Myers )
213
- . iter_all_changes ( )
214
- {
215
- match change. tag ( ) {
216
- Delete => {
217
- lines. removed += 1 ;
218
- nl += 1 ;
219
- }
220
- Insert => {
221
- lines. added += 1 ;
222
- nl += 1
223
- }
224
- Equal => { }
207
+ if let Some ( Ok ( diff) ) =
208
+ line_stats. then ( || change. event . diff ( ) ) . flatten ( )
209
+ {
210
+ use git:: diff:: lines:: similar:: ChangeTag :: * ;
211
+ let mut nl = 0 ;
212
+ for change in diff
213
+ . text ( git:: diff:: lines:: Algorithm :: Myers )
214
+ . iter_all_changes ( )
215
+ {
216
+ match change. tag ( ) {
217
+ Delete => {
218
+ lines. removed += 1 ;
219
+ nl += 1 ;
225
220
}
221
+ Insert => {
222
+ lines. added += 1 ;
223
+ nl += 1
224
+ }
225
+ Equal => { }
226
226
}
227
- if let Some ( c ) = lines_counter . as_ref ( ) {
228
- c . fetch_add ( nl , Ordering :: SeqCst ) ;
229
- }
227
+ }
228
+ if let Some ( c ) = lines_counter . as_ref ( ) {
229
+ c . fetch_add ( nl , Ordering :: SeqCst ) ;
230
230
}
231
231
}
232
232
}
You can’t perform that action at this time.
0 commit comments