From 1649ff3e71f4439c3ef9bb81e1d27df4ec86b28f Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Thu, 10 Nov 2022 10:15:19 +0000 Subject: [PATCH] radicle-surf: remove RefScope RefScope is no longer used, so it's removed. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-surf/src/vcs/git.rs | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/radicle-surf/src/vcs/git.rs b/radicle-surf/src/vcs/git.rs index ac8ed28..c5a73c0 100644 --- a/radicle-surf/src/vcs/git.rs +++ b/radicle-surf/src/vcs/git.rs @@ -115,41 +115,14 @@ impl From for Signature { } } -/// Determines whether to look for local or remote references or both. -pub enum RefScope { - /// List all branches by default. - All, - /// List only local branches. - Local, - /// List only remote branches. - Remote { - /// Name of the remote. If `None`, then get the reference from all - /// remotes. - name: Option, - }, -} - -/// Turn an `Option

` into a [`RefScope`]. If the `P` is present then -/// this is set as the remote of the `RefScope`. Otherwise, it's local -/// branch. -impl

From> for RefScope -where - P: ToString, -{ - fn from(peer_id: Option

) -> Self { - peer_id.map_or(RefScope::Local, |peer_id| RefScope::Remote { - // We qualify the remotes as the PeerId + heads, otherwise we would grab the tags too. - name: Some(format!("{}/heads", peer_id.to_string())), - }) - } -} - /// Supports various ways to specify a revision used in Git. pub trait Revision { /// Returns the object id of this revision in `repo`. fn object_id(&self, repo: &RepositoryRef) -> Result; } + + impl Revision for Oid { fn object_id(&self, _repo: &RepositoryRef) -> Result { Ok(*self)