summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/ext/reference.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix/src/ext/reference.rs')
-rw-r--r--vendor/gix/src/ext/reference.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/gix/src/ext/reference.rs b/vendor/gix/src/ext/reference.rs
new file mode 100644
index 000000000..57e4e4fe7
--- /dev/null
+++ b/vendor/gix/src/ext/reference.rs
@@ -0,0 +1,15 @@
+pub trait Sealed {}
+
+impl Sealed for gix_ref::Reference {}
+
+/// Extensions for [references][gix_ref::Reference].
+pub trait ReferenceExt {
+ /// Attach [`Repository`][crate::Repository] to the given reference. It can be detached later with [`detach()]`.
+ fn attach(self, repo: &crate::Repository) -> crate::Reference<'_>;
+}
+
+impl ReferenceExt for gix_ref::Reference {
+ fn attach(self, repo: &crate::Repository) -> crate::Reference<'_> {
+ crate::Reference::from_ref(self, repo)
+ }
+}