upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/git_remote_nostr/list.rs0
-rw-r--r--src/bin/git_remote_nostr/main.rs1
-rw-r--r--src/lib/git/nostr_url.rs8
3 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/git_remote_nostr/list.rs b/src/bin/git_remote_nostr/list.rs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/bin/git_remote_nostr/list.rs
diff --git a/src/bin/git_remote_nostr/main.rs b/src/bin/git_remote_nostr/main.rs
index 3e08efe..8d67552 100644
--- a/src/bin/git_remote_nostr/main.rs
+++ b/src/bin/git_remote_nostr/main.rs
@@ -10,6 +10,7 @@ use std::{
10 env, 10 env,
11 io::{self, Stdin}, 11 io::{self, Stdin},
12 path::{Path, PathBuf}, 12 path::{Path, PathBuf},
13 str::FromStr,
13}; 14};
14 15
15use anyhow::{anyhow, bail, Context, Result}; 16use anyhow::{anyhow, bail, Context, Result};
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs
index ce3e973..d1fee2e 100644
--- a/src/lib/git/nostr_url.rs
+++ b/src/lib/git/nostr_url.rs
@@ -21,8 +21,10 @@ pub struct NostrUrlDecoded {
21 21
22static INCORRECT_NOSTR_URL_FORMAT_ERROR: &str = "incorrect nostr git url format. try nostr://naddr123 or nostr://npub123/my-repo or nostr://ssh/npub123/relay.damus.io/my-repo"; 22static INCORRECT_NOSTR_URL_FORMAT_ERROR: &str = "incorrect nostr git url format. try nostr://naddr123 or nostr://npub123/my-repo or nostr://ssh/npub123/relay.damus.io/my-repo";
23 23
24impl NostrUrlDecoded { 24impl std::str::FromStr for NostrUrlDecoded {
25 pub fn from_str(url: &str) -> Result<Self> { 25 type Err = anyhow::Error;
26
27 fn from_str(url: &str) -> Result<Self> {
26 let mut coordinates = HashSet::new(); 28 let mut coordinates = HashSet::new();
27 let mut protocol = None; 29 let mut protocol = None;
28 let mut user = None; 30 let mut user = None;
@@ -257,6 +259,8 @@ mod tests {
257 } 259 }
258 260
259 mod nostr_git_url_paramemters_from_str { 261 mod nostr_git_url_paramemters_from_str {
262 use std::str::FromStr;
263
260 use super::*; 264 use super::*;
261 265
262 fn get_model_coordinate(relays: bool) -> Coordinate { 266 fn get_model_coordinate(relays: bool) -> Coordinate {