diff options
Diffstat (limited to 'vendor/gix/src/ext/rev_spec.rs')
-rw-r--r-- | vendor/gix/src/ext/rev_spec.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/gix/src/ext/rev_spec.rs b/vendor/gix/src/ext/rev_spec.rs new file mode 100644 index 000000000..ed7dc0460 --- /dev/null +++ b/vendor/gix/src/ext/rev_spec.rs @@ -0,0 +1,20 @@ +pub trait Sealed {} + +impl Sealed for gix_ref::Reference {} + +/// Extensions for [revision specifications][gix_revision::Spec]. +pub trait RevSpecExt { + /// Attach [`Repository`][crate::Repository] to the given rev-spec. + fn attach(self, repo: &crate::Repository) -> crate::revision::Spec<'_>; +} + +impl RevSpecExt for gix_revision::Spec { + fn attach(self, repo: &crate::Repository) -> crate::revision::Spec<'_> { + crate::revision::Spec { + inner: self, + first_ref: None, + second_ref: None, + repo, + } + } +} |