Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gix-worktree-stream/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gix-traverse = { version = "^0.52.0", path = "../gix-traverse" }
gix-fs = { version = "^0.19.0", path = "../gix-fs" }
gix-path = { version = "^0.11.0", path = "../gix-path" }

thiserror = "2.0.17"
gix-error = { version = "^0.0.0", path = "../gix-error" }
parking_lot = "0.12.4"

[dev-dependencies]
Expand Down
21 changes: 0 additions & 21 deletions gix-worktree-stream/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ use gix_object::bstr::{BStr, BString};

use crate::{protocol, Entry, Stream};

/// The error returned by [`next_entry()`][Stream::next_entry()].
#[derive(Debug, thiserror::Error)]
#[allow(missing_docs)]
pub enum Error {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error("Could not find a tree's leaf, typically a blob")]
Find(#[from] gix_object::find::existing::Error),
#[error("Could not find a tree to traverse")]
FindTree(#[from] gix_object::find::existing_iter::Error),
#[error("Could not query attributes for path \"{path}\"")]
Attributes {
path: BString,
source: Box<dyn std::error::Error + Send + Sync + 'static>,
},
#[error(transparent)]
Traverse(#[from] gix_traverse::tree::breadthfirst::Error),
#[error(transparent)]
ConvertToWorktree(#[from] gix_filter::pipeline::convert::to_worktree::Error),
}

impl Stream {
/// Access the next entry of the stream or `None` if there is nothing more to read.
pub fn next_entry(&mut self) -> Result<Option<Entry<'_>>, Error> {
Expand Down
9 changes: 3 additions & 6 deletions gix-worktree-stream/src/from_tree/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::io::Write;

use gix_error::{message, ResultExt};
use gix_object::{bstr::BStr, FindExt};
use std::io::Write;

use crate::{entry, entry::Error, protocol, AdditionalEntry, SharedErrorSlot, Stream};

Expand Down Expand Up @@ -102,10 +102,7 @@ where
attrs,
objects: objects.clone(),
fetch_attributes: move |a: &BStr, b: gix_object::tree::EntryMode, c: &mut gix_attributes::search::Outcome| {
attributes(a, b, c).map_err(|err| Error::Attributes {
source: Box::new(err),
path: a.to_owned(),
})
attributes(a, b, c).or_raise(|| message!("Could not query attributes for path \"{a}\""))
},
path_deque: Default::default(),
path: Default::default(),
Expand Down
Loading