summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/ext/reference.rs
blob: 57e4e4fe7c9f95c50d93038ec46ddf94c67a4528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)
    }
}