@@ -101,7 +101,9 @@ pub(crate) mod function {
101
101
recurse_submodules : bool ,
102
102
out : & mut impl std:: io:: Write ,
103
103
) -> anyhow:: Result < Statistics > {
104
+ let _span = gix:: trace:: coarse!( "print_entries()" , git_dir = ?repo. git_dir( ) ) ;
104
105
let ( mut pathspec, index, mut cache) = init_cache ( repo, attributes, pathspecs. clone ( ) ) ?;
106
+ let mut repo_attrs = all_attrs. is_some ( ) . then ( BTreeSet :: default) ;
105
107
let submodules_by_path = recurse_submodules
106
108
. then ( || {
107
109
repo. submodules ( )
@@ -142,7 +144,7 @@ pub(crate) mod function {
142
144
} ;
143
145
stats. with_attributes += usize:: from ( !attributes. is_empty ( ) ) ;
144
146
stats. max_attributes_per_path = stats. max_attributes_per_path . max ( attributes. len ( ) ) ;
145
- if let Some ( attrs) = all_attrs . as_deref_mut ( ) {
147
+ if let Some ( attrs) = repo_attrs . as_mut ( ) {
146
148
attributes. iter ( ) . for_each ( |attr| {
147
149
attrs. insert ( attr. clone ( ) ) ;
148
150
} ) ;
@@ -232,6 +234,12 @@ pub(crate) mod function {
232
234
}
233
235
234
236
stats. cache = cache. map ( |c| * c. 1 . statistics ( ) ) ;
237
+ if let Some ( ( attrs, all_attrs) ) = repo_attrs. zip ( all_attrs) {
238
+ stats
239
+ . attributes
240
+ . extend ( attrs. iter ( ) . map ( |attr| attr. as_ref ( ) . to_string ( ) ) ) ;
241
+ all_attrs. extend ( attrs) ;
242
+ }
235
243
Ok ( stats)
236
244
}
237
245
@@ -301,6 +309,7 @@ pub(crate) mod function {
301
309
pub with_attributes : usize ,
302
310
pub max_attributes_per_path : usize ,
303
311
pub cache : Option < gix:: worktree:: stack:: Statistics > ,
312
+ pub attributes : Vec < String > ,
304
313
pub submodule : Vec < ( BString , Statistics ) > ,
305
314
}
306
315
0 commit comments