Skip to content

Commit 531179c

Browse files
committed
adapt to changes in gix-traverse
1 parent ea0babe commit 531179c

File tree

6 files changed

+21
-1
lines changed

6 files changed

+21
-1
lines changed

gitoxide-core/src/repository/tree.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ mod entries {
6666
}
6767

6868
impl gix::traverse::tree::Visit for Traverse<'_, '_> {
69+
fn pop_back_tracked_path_and_set_current(&mut self) {
70+
self.path = self.path_deque.pop_back().unwrap_or_default();
71+
}
72+
6973
fn pop_front_tracked_path_and_set_current(&mut self) {
7074
self.path = self.path_deque.pop_front().expect("every parent is set only once");
7175
}
@@ -96,7 +100,7 @@ mod entries {
96100
format_entry(out, entry, self.path.as_bstr(), size).ok();
97101
}
98102
if let Some(size) = size {
99-
self.stats.num_bytes += size as u64;
103+
self.stats.num_bytes += size;
100104
}
101105

102106
use gix::object::tree::EntryKind::*;

gix-diff/src/tree_with_rewrites/function.rs

+4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ mod tree_to_changes {
239239
}
240240

241241
impl gix_traverse::tree::Visit for Delegate<'_> {
242+
fn pop_back_tracked_path_and_set_current(&mut self) {
243+
self.recorder.pop_back_tracked_path_and_set_current();
244+
}
245+
242246
fn pop_front_tracked_path_and_set_current(&mut self) {
243247
self.recorder.pop_front_tracked_path_and_set_current();
244248
}

gix-index/src/init.rs

+4
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ pub mod from_tree {
182182
}
183183

184184
impl Visit for CollectEntries {
185+
fn pop_back_tracked_path_and_set_current(&mut self) {
186+
self.path = self.path_deque.pop_back().unwrap_or_default();
187+
}
188+
185189
fn pop_front_tracked_path_and_set_current(&mut self) {
186190
self.path = self
187191
.path_deque

gix-pack/src/data/output/count/objects/tree.rs

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ pub mod traverse {
9494
where
9595
H: InsertImmutable,
9696
{
97+
fn pop_back_tracked_path_and_set_current(&mut self) {}
98+
9799
fn pop_front_tracked_path_and_set_current(&mut self) {}
98100

99101
fn push_back_tracked_path_component(&mut self, _component: &BStr) {}

gix-worktree-stream/src/from_tree/traverse.rs

+4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ where
105105
AttributesFn:
106106
FnMut(&BStr, gix_object::tree::EntryMode, &mut gix_attributes::search::Outcome) -> Result<(), Error> + 'static,
107107
{
108+
fn pop_back_tracked_path_and_set_current(&mut self) {
109+
self.path = self.path_deque.pop_back().unwrap_or_default();
110+
}
111+
108112
fn pop_front_tracked_path_and_set_current(&mut self) {
109113
self.path = self
110114
.path_deque

gix/examples/stats.rs

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ mod visit {
105105
}
106106
}
107107
impl gix_traverse::tree::Visit for Tree {
108+
fn pop_back_tracked_path_and_set_current(&mut self) {}
109+
108110
fn pop_front_tracked_path_and_set_current(&mut self) {}
109111

110112
fn push_back_tracked_path_component(&mut self, _component: &BStr) {}

0 commit comments

Comments
 (0)