upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands/init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/sub_commands/init.rs')
-rw-r--r--src/bin/ngit/sub_commands/init.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs
index 1b9ba5e..3dc63ad 100644
--- a/src/bin/ngit/sub_commands/init.rs
+++ b/src/bin/ngit/sub_commands/init.rs
@@ -302,21 +302,25 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
302 args.clone_url.clone() 302 args.clone_url.clone()
303 }; 303 };
304 304
305 // TODO: check if relays are free to post to so contributors can submit patches 305 // TODO: when NIP-66 is functional, use this to reccommend relays and filter out
306 // TODO: recommend some reliable free ones 306 // relays that won't accept contributors events. NIP-11 'limitations'
307 // isn't widely used enough to be usedful.
308
307 let relays: Vec<RelayUrl> = { 309 let relays: Vec<RelayUrl> = {
308 let mut default = if let Ok(config) = &repo_config_result { 310 let mut default = if let Ok(config) = &repo_config_result {
309 config.relays.clone().join(" ") 311 config.relays.clone()
310 } else if let Some(repo_ref) = &repo_ref { 312 } else if let Some(repo_ref) = &repo_ref {
311 repo_ref 313 repo_ref
312 .relays 314 .relays
313 .iter() 315 .iter()
314 .map(std::string::ToString::to_string) 316 .map(std::string::ToString::to_string)
315 .collect::<Vec<String>>() 317 .collect::<Vec<String>>()
316 .join(" ") 318 } else if user_ref.relays.read().is_empty() {
319 client.get_fallback_relays().clone()
317 } else { 320 } else {
318 user_ref.relays.write().join(" ") 321 user_ref.relays.read().clone()
319 }; 322 }
323 .join(" ");
320 'outer: loop { 324 'outer: loop {
321 let relays: Vec<String> = if args.relays.is_empty() { 325 let relays: Vec<String> = if args.relays.is_empty() {
322 Interactor::default() 326 Interactor::default()