Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: don't override existing seeding scope in `rad seed`
✗ CI failure Defelo committed 1 month ago
commit c975f793296df421c28a546aa27235555b24fb5d
parent ff85c74eaa2f4d01382fe90ab0525ec78f72b04c
1 failed (1 total) View logs
2 files changed +13 -8
modified crates/radicle-cli/src/commands/seed.rs
@@ -41,10 +41,19 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {

pub fn update(
    rid: RepoId,
-
    scope: Scope,
+
    scope: Option<Scope>,
    node: &mut Node,
    profile: &Profile,
) -> Result<(), anyhow::Error> {
+
    let scope = match scope {
+
        Some(scope) => scope,
+
        None => profile
+
            .policies()?
+
            .seed_policy(&rid)?
+
            .scope()
+
            .unwrap_or(Scope::Followed),
+
    };
+

    let updated = profile.seed(rid, scope, node)?;
    let outcome = if updated { "updated" } else { "exists" };

modified crates/radicle-cli/src/commands/seed/args.rs
@@ -47,12 +47,8 @@ pub struct Args {
    timeout: u64,

    /// Peer follow scope for this repository
-
    #[arg(
-
        long,
-
        default_value_t = Scope::Followed,
-
        value_parser = terminal::args::ScopeParser
-
    )]
-
    pub(super) scope: Scope,
+
    #[arg(long, value_parser = terminal::args::ScopeParser)]
+
    pub(super) scope: Option<Scope>,

    /// Verbose output
    #[arg(long, short)]
@@ -65,7 +61,7 @@ pub(super) enum Operation {
        rids: NonEmpty<RepoId>,
        should_fetch: bool,
        settings: SyncSettings,
-
        scope: Scope,
+
        scope: Option<Scope>,
    },
}