File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
gitoxide-core/src/repository/index Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -294,7 +294,13 @@ pub(crate) mod function {
294
294
Ok ( ( pathspec. into_parts ( ) . 0 , index, cache) )
295
295
}
296
296
297
- #[ cfg_attr( feature = "serde" , derive( serde:: Serialize ) ) ]
297
+ #[ cfg( feature = "serde" ) ]
298
+ #[ derive( serde:: Serialize ) ]
299
+ struct AttrsForSerde {
300
+ is_excluded : bool ,
301
+ attributes : Vec < String > ,
302
+ }
303
+
298
304
struct Attrs {
299
305
is_excluded : bool ,
300
306
attributes : Vec < gix:: attrs:: Assignment > ,
@@ -331,7 +337,7 @@ pub(crate) mod function {
331
337
flags : u32 ,
332
338
mode : u32 ,
333
339
path : std:: borrow:: Cow < ' a , str > ,
334
- meta : Option < Attrs > ,
340
+ meta : Option < AttrsForSerde > ,
335
341
}
336
342
337
343
serde_json:: to_writer (
@@ -348,7 +354,14 @@ pub(crate) mod function {
348
354
path. extend_from_slice ( entry. path ( index) ) ;
349
355
path. to_string ( ) . into ( )
350
356
} ,
351
- meta : attrs,
357
+ meta : attrs. map ( |attrs| AttrsForSerde {
358
+ is_excluded : attrs. is_excluded ,
359
+ attributes : attrs
360
+ . attributes
361
+ . into_iter ( )
362
+ . map ( |attr| attr. as_ref ( ) . to_string ( ) )
363
+ . collect ( ) ,
364
+ } ) ,
352
365
} ,
353
366
) ?;
354
367
You can’t perform that action at this time.
0 commit comments