mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 14:00:31 +08:00
radicle/storage/refs: Remove RefAt::load
This is a very thin wrapper around `SignedRefs::load_at` which only has a single usage in all of the workspace. Remove it.
This commit is contained in:
committed by
Fintan Halpenny
parent
ec36d1c3ae
commit
6d771abfcc
@@ -14,7 +14,7 @@ use radicle::identity::{DocAt, Identity};
|
||||
use radicle::node::policy::SeedingPolicy;
|
||||
use radicle::node::AliasStore as _;
|
||||
use radicle::storage::git::{Repository, Storage};
|
||||
use radicle::storage::refs::{FeatureLevel, RefsAt};
|
||||
use radicle::storage::refs::{FeatureLevel, RefsAt, SignedRefs};
|
||||
use radicle::storage::{ReadRepository, ReadStorage};
|
||||
|
||||
use crate::terminal as term;
|
||||
@@ -68,7 +68,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
for remote in repo.remote_ids()? {
|
||||
let remote = remote?;
|
||||
let refs = RefsAt::new(&repo, remote)?;
|
||||
let sigrefs = refs.load(&repo);
|
||||
let sigrefs = SignedRefs::load_at(refs.at, remote, &repo);
|
||||
|
||||
println!(
|
||||
"{:<48} {} {}",
|
||||
|
||||
@@ -330,7 +330,8 @@ impl std::fmt::Display for FeatureLevel {
|
||||
/// The content-addressable information required to load a remote's
|
||||
/// `rad/sigrefs`.
|
||||
///
|
||||
/// Use [`RefsAt::load`] to produce [`SignedRefs`].
|
||||
/// Use [`RefsAt::remote`] and [`RefsAt::at`] with [`SignedRefs::load_at`] to
|
||||
/// attempt loading the expected signed references.
|
||||
///
|
||||
/// `RefsAt` can also be used for communicating announcements of updates
|
||||
/// references to other nodes.
|
||||
@@ -358,14 +359,6 @@ impl RefsAt {
|
||||
Ok(RefsAt { remote, at })
|
||||
}
|
||||
|
||||
pub fn load<R>(&self, repo: &R) -> Result<Option<SignedRefs>, sigrefs::read::error::Read>
|
||||
where
|
||||
R: HasRepoId,
|
||||
R: sigrefs::git::object::Reader + sigrefs::git::reference::Reader,
|
||||
{
|
||||
SignedRefs::load_at(self.at, self.remote, repo)
|
||||
}
|
||||
|
||||
pub fn path(&self) -> &git::fmt::Qualified<'_> {
|
||||
&SIGREFS_BRANCH
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user