mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
radicle: Remove ReadRepository::identity_root_of
This function is unused.
This commit is contained in:
@@ -545,9 +545,6 @@ pub trait ReadRepository: Sized + ValidateRepository {
|
||||
/// Get the root commit of the canonical identity branch.
|
||||
fn identity_root(&self) -> Result<Oid, RepositoryError>;
|
||||
|
||||
/// Get the root commit of the identity branch of a specific remote.
|
||||
fn identity_root_of(&self, remote: &RemoteId) -> Result<Oid, RepositoryError>;
|
||||
|
||||
/// Load the identity history.
|
||||
fn identity(&self) -> Result<Identity, RepositoryError>
|
||||
where
|
||||
|
||||
@@ -891,21 +891,6 @@ impl ReadRepository for Repository {
|
||||
Ok(root.into())
|
||||
}
|
||||
|
||||
fn identity_root_of(&self, remote: &RemoteId) -> Result<Oid, RepositoryError> {
|
||||
// Remotes that run newer clients will have this reference set. For older clients,
|
||||
// compute the root OID based on the identity head.
|
||||
if let Ok(root) = self.reference_oid(remote, &git::refs::storage::IDENTITY_ROOT) {
|
||||
return Ok(root);
|
||||
}
|
||||
let oid = self.identity_head_of(remote)?;
|
||||
let root = self
|
||||
.revwalk(oid)?
|
||||
.last()
|
||||
.ok_or(RepositoryError::Doc(DocError::Missing))??;
|
||||
|
||||
Ok(root.into())
|
||||
}
|
||||
|
||||
fn canonical_identity_head(&self) -> Result<Oid, RepositoryError> {
|
||||
let blob = match self.backend.find_blob(self.id.deref().into()) {
|
||||
Ok(blob) => blob,
|
||||
|
||||
@@ -365,10 +365,6 @@ impl<R: storage::ReadRepository> ReadRepository for DraftStore<'_, R> {
|
||||
self.repo.identity_root()
|
||||
}
|
||||
|
||||
fn identity_root_of(&self, remote: &RemoteId) -> Result<Oid, RepositoryError> {
|
||||
self.repo.identity_root_of(remote)
|
||||
}
|
||||
|
||||
fn canonical_identity_head(&self) -> Result<Oid, RepositoryError> {
|
||||
self.repo.canonical_identity_head()
|
||||
}
|
||||
|
||||
@@ -327,10 +327,6 @@ impl ReadRepository for MockRepository {
|
||||
Ok(self.doc.commit)
|
||||
}
|
||||
|
||||
fn identity_root_of(&self, _remote: &RemoteId) -> Result<Oid, RepositoryError> {
|
||||
Ok(self.doc.commit)
|
||||
}
|
||||
|
||||
fn canonical_identity_head(&self) -> Result<Oid, RepositoryError> {
|
||||
Ok(self.doc.commit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user