Skip to content

Commit 0fac1b9

Browse files
committed
adapt to changes in gix-attributes
1 parent 7911d53 commit 0fac1b9

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

gitoxide-core/src/repository/index/entries.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ pub(crate) mod function {
294294
Ok((pathspec.into_parts().0, index, cache))
295295
}
296296

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+
298304
struct Attrs {
299305
is_excluded: bool,
300306
attributes: Vec<gix::attrs::Assignment>,
@@ -331,7 +337,7 @@ pub(crate) mod function {
331337
flags: u32,
332338
mode: u32,
333339
path: std::borrow::Cow<'a, str>,
334-
meta: Option<Attrs>,
340+
meta: Option<AttrsForSerde>,
335341
}
336342

337343
serde_json::to_writer(
@@ -348,7 +354,14 @@ pub(crate) mod function {
348354
path.extend_from_slice(entry.path(index));
349355
path.to_string().into()
350356
},
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+
}),
352365
},
353366
)?;
354367

0 commit comments

Comments
 (0)