From b10340cb00a00da07d0ae735796d83801454779e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 20 Feb 2026 21:14:45 +0000 Subject: use trusted maintainer's grasp servers as fallback for co-maintainers when a co-maintainer has no grasp servers of their own, fall back to the trusted maintainer's grasp servers rather than jumping straight to system defaults. if the trusted maintainer only uses a single grasp server, the first system default is appended for redundancy. system defaults are only used when neither the user nor the trusted maintainer has any grasp servers configured. --- src/bin/ngit/sub_commands/init.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/bin/ngit/sub_commands') diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index 5c43e6e..5ff57d5 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -282,12 +282,23 @@ fn resolve_grasp_servers( if !interactive || cli.defaults || state.has_coordinate() || cli.force { // Prefer grasp servers from my existing announcement, then user's grasp - // list, then system fallbacks + // list (or trusted maintainer's servers as fallback), then system defaults let existing = detect_existing_grasp_servers(my_ref.as_ref(), &args.relay, &[], identifier); if !existing.is_empty() { return Ok(existing); } - return Ok(grasp_servers_from_user_or_fallback(user_ref, client)); + // For co-maintainer state, pass the repo_ref so the trusted + // maintainer's grasp servers can be used as a fallback. + let trusted_maintainer_repo_ref = if matches!(state, InitState::CoMaintainer { .. }) { + state.repo_ref() + } else { + None + }; + return Ok(grasp_servers_from_user_or_fallback( + user_ref, + trusted_maintainer_repo_ref, + client, + )); } // Interactive prompt -- cgit v1.2.3