From 4ec930daf9e80c1ea27a44a4465200486fe714aa Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 2 Aug 2024 11:21:13 +0100 Subject: fix: identifer in parse `nostr://npub/identifer` as it was hardcoded to test value --- src/git_remote_helper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs index f8a9db4..2fa1aad 100644 --- a/src/git_remote_helper.rs +++ b/src/git_remote_helper.rs @@ -156,7 +156,7 @@ fn nostr_git_url_to_repo_coordinates(url: &str) -> Result> { if let Some(domain) = url.domain() { if let Ok(public_key) = PublicKey::parse(domain) { - if url.path().is_empty() { + if url.path().len() < 2 { bail!( "nostr git url should include the repo identifier eg nostr://npub123/the-repo-identifer" ); @@ -176,7 +176,7 @@ fn nostr_git_url_to_repo_coordinates(url: &str) -> Result> { } } repo_coordinattes.insert(Coordinate { - identifier: "ngit".to_string(), + identifier: url.path()[1..].to_string(), public_key, kind: nostr_sdk::Kind::GitRepoAnnouncement, relays, -- cgit v1.2.3