cli: use Doc::canonical in rad inspect
A project may exist within storage without the local operator not having a fork of the project. Use Doc::canonical in rad inspect to retrieve the canonical identity document for use during inspection. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
parent
327ebd4d2a
commit
92a14b671f
|
|
@ -8,7 +8,7 @@ use anyhow::{anyhow, Context as _};
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use json_color::{Color, Colorizer};
|
use json_color::{Color, Colorizer};
|
||||||
|
|
||||||
use radicle::crypto::Unverified;
|
use radicle::crypto::{Unverified, Verified};
|
||||||
use radicle::identity::Untrusted;
|
use radicle::identity::Untrusted;
|
||||||
use radicle::identity::{Doc, Id};
|
use radicle::identity::{Doc, Id};
|
||||||
use radicle::storage::{ReadRepository, ReadStorage};
|
use radicle::storage::{ReadRepository, ReadStorage};
|
||||||
|
|
@ -120,9 +120,10 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||||
let profile = ctx.profile()?;
|
let profile = ctx.profile()?;
|
||||||
let storage = &profile.storage;
|
let storage = &profile.storage;
|
||||||
let signer = term::signer(&profile)?;
|
let signer = term::signer(&profile)?;
|
||||||
let project = storage
|
let repo = storage
|
||||||
.get(signer.public_key(), id)?
|
.repository(id)
|
||||||
.context("No project with the given RID exists")?;
|
.context("No project with the given RID exists")?;
|
||||||
|
let project = Doc::<Verified>::canonical(&repo)?;
|
||||||
|
|
||||||
match options.target {
|
match options.target {
|
||||||
Target::Refs => {
|
Target::Refs => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue