Skip to content

Commit e3c445e

Browse files
committed
fix: gix tree entries usees find_header() to show the object size.
1 parent 6ed9976 commit e3c445e

File tree

1 file changed

+3
-5
lines changed
  • gitoxide-core/src/repository

1 file changed

+3
-5
lines changed

gitoxide-core/src/repository/tree.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ mod entries {
9191
fn visit_nontree(&mut self, entry: &EntryRef<'_>) -> Action {
9292
let size = self
9393
.repo
94-
.and_then(|repo| repo.find_object(entry.oid).map(|o| o.data.len()).ok());
94+
.and_then(|repo| repo.find_header(entry.oid).map(|h| h.size()).ok());
9595
if let Some(out) = &mut self.out {
9696
format_entry(out, entry, self.path.as_bstr(), size).ok();
9797
}
@@ -163,9 +163,7 @@ pub fn entries(
163163
&mut out,
164164
&entry.inner,
165165
entry.inner.filename,
166-
extended
167-
.then(|| entry.id().object().map(|o| o.data.len()))
168-
.transpose()?,
166+
extended.then(|| entry.id().header().map(|o| o.size())).transpose()?,
169167
)?;
170168
}
171169
}
@@ -182,7 +180,7 @@ fn format_entry(
182180
mut out: impl io::Write,
183181
entry: &gix::objs::tree::EntryRef<'_>,
184182
filename: &gix::bstr::BStr,
185-
size: Option<usize>,
183+
size: Option<u64>,
186184
) -> std::io::Result<()> {
187185
use gix::objs::tree::EntryKind::*;
188186
writeln!(

0 commit comments

Comments
 (0)