summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/ext
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix/src/ext
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/ext')
-rw-r--r--vendor/gix/src/ext/mod.rs4
-rw-r--r--vendor/gix/src/ext/tree.rs24
2 files changed, 27 insertions, 1 deletions
diff --git a/vendor/gix/src/ext/mod.rs b/vendor/gix/src/ext/mod.rs
index beb9007fa..ad69fec07 100644
--- a/vendor/gix/src/ext/mod.rs
+++ b/vendor/gix/src/ext/mod.rs
@@ -1,9 +1,11 @@
pub use object_id::ObjectIdExt;
pub use reference::ReferenceExt;
+#[cfg(feature = "revision")]
pub use rev_spec::RevSpecExt;
-pub use tree::TreeIterExt;
+pub use tree::{TreeEntryExt, TreeEntryRefExt, TreeIterExt};
mod object_id;
mod reference;
+#[cfg(feature = "revision")]
mod rev_spec;
mod tree;
diff --git a/vendor/gix/src/ext/tree.rs b/vendor/gix/src/ext/tree.rs
index 09220fc40..56b832b84 100644
--- a/vendor/gix/src/ext/tree.rs
+++ b/vendor/gix/src/ext/tree.rs
@@ -42,3 +42,27 @@ impl<'d> TreeIterExt for TreeRefIter<'d> {
breadthfirst(self.clone(), state, find, delegate)
}
}
+
+/// Extensions for [EntryRef][gix_object::tree::EntryRef].
+pub trait TreeEntryRefExt<'a>: 'a {
+ /// Attach [`Repository`][crate::Repository] to the given tree entry. It can be detached later with `detach()`.
+ fn attach<'repo>(self, repo: &'repo crate::Repository) -> crate::object::tree::EntryRef<'repo, 'a>;
+}
+
+impl<'a> TreeEntryRefExt<'a> for gix_object::tree::EntryRef<'a> {
+ fn attach<'repo>(self, repo: &'repo crate::Repository) -> crate::object::tree::EntryRef<'repo, 'a> {
+ crate::object::tree::EntryRef { inner: self, repo }
+ }
+}
+
+/// Extensions for [Entry][gix_object::tree::Entry].
+pub trait TreeEntryExt {
+ /// Attach [`Repository`][crate::Repository] to the given tree entry. It can be detached later with `detach()`.
+ fn attach(self, repo: &crate::Repository) -> crate::object::tree::Entry<'_>;
+}
+
+impl TreeEntryExt for gix_object::tree::Entry {
+ fn attach(self, repo: &crate::Repository) -> crate::object::tree::Entry<'_> {
+ crate::object::tree::Entry { inner: self, repo }
+ }
+}