diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-02 11:21:13 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-02 11:41:41 +0100 |
| commit | 4ec930daf9e80c1ea27a44a4465200486fe714aa (patch) | |
| tree | 4e1637b4e8a48593fe737316cbc375cf7e1ea6e9 | |
| parent | 2de11e4099a1f841666eac6a1f68389b01c3398b (diff) | |
fix: identifer in parse `nostr://npub/identifer`
as it was hardcoded to test value
| -rw-r--r-- | src/git_remote_helper.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<HashSet<Coordinate>> { | |||
| 156 | 156 | ||
| 157 | if let Some(domain) = url.domain() { | 157 | if let Some(domain) = url.domain() { |
| 158 | if let Ok(public_key) = PublicKey::parse(domain) { | 158 | if let Ok(public_key) = PublicKey::parse(domain) { |
| 159 | if url.path().is_empty() { | 159 | if url.path().len() < 2 { |
| 160 | bail!( | 160 | bail!( |
| 161 | "nostr git url should include the repo identifier eg nostr://npub123/the-repo-identifer" | 161 | "nostr git url should include the repo identifier eg nostr://npub123/the-repo-identifer" |
| 162 | ); | 162 | ); |
| @@ -176,7 +176,7 @@ fn nostr_git_url_to_repo_coordinates(url: &str) -> Result<HashSet<Coordinate>> { | |||
| 176 | } | 176 | } |
| 177 | } | 177 | } |
| 178 | repo_coordinattes.insert(Coordinate { | 178 | repo_coordinattes.insert(Coordinate { |
| 179 | identifier: "ngit".to_string(), | 179 | identifier: url.path()[1..].to_string(), |
| 180 | public_key, | 180 | public_key, |
| 181 | kind: nostr_sdk::Kind::GitRepoAnnouncement, | 181 | kind: nostr_sdk::Kind::GitRepoAnnouncement, |
| 182 | relays, | 182 | relays, |