upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr')
-rw-r--r--src/bin/git_remote_nostr/fetch.rs2
-rw-r--r--src/bin/git_remote_nostr/main.rs4
-rw-r--r--src/bin/git_remote_nostr/push.rs17
3 files changed, 14 insertions, 9 deletions
diff --git a/src/bin/git_remote_nostr/fetch.rs b/src/bin/git_remote_nostr/fetch.rs
index 5ee4271..a7210d0 100644
--- a/src/bin/git_remote_nostr/fetch.rs
+++ b/src/bin/git_remote_nostr/fetch.rs
@@ -115,7 +115,7 @@ pub fn make_commits_for_proposal(
115 author: Some(patch.pubkey), 115 author: Some(patch.pubkey),
116 kind: Some(patch.kind), 116 kind: Some(patch.kind),
117 relays: if let Some(relay) = repo_ref.relays.first() { 117 relays: if let Some(relay) = repo_ref.relays.first() {
118 vec![relay.to_string()] 118 vec![relay.to_owned()]
119 } else { 119 } else {
120 vec![] 120 vec![]
121 }, 121 },
diff --git a/src/bin/git_remote_nostr/main.rs b/src/bin/git_remote_nostr/main.rs
index 44359dd..daa924f 100644
--- a/src/bin/git_remote_nostr/main.rs
+++ b/src/bin/git_remote_nostr/main.rs
@@ -15,7 +15,7 @@ use anyhow::{Context, Result, bail};
15use client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache}; 15use client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache};
16use git::{RepoActions, nostr_url::NostrUrlDecoded}; 16use git::{RepoActions, nostr_url::NostrUrlDecoded};
17use ngit::{client, git, login::existing::load_existing_login}; 17use ngit::{client, git, login::existing::load_existing_login};
18use nostr::nips::nip01::Coordinate; 18use nostr::nips::nip19::Nip19Coordinate;
19use utils::read_line; 19use utils::read_line;
20 20
21use crate::{client::Client, git::Repo}; 21use crate::{client::Client, git::Repo};
@@ -148,7 +148,7 @@ async fn process_args() -> Result<Option<(NostrUrlDecoded, Repo)>> {
148async fn fetching_with_report_for_helper( 148async fn fetching_with_report_for_helper(
149 git_repo_path: &Path, 149 git_repo_path: &Path,
150 client: &Client, 150 client: &Client,
151 trusted_maintainer_coordinate: &Coordinate, 151 trusted_maintainer_coordinate: &Nip19Coordinate,
152) -> Result<()> { 152) -> Result<()> {
153 let term = console::Term::stderr(); 153 let term = console::Term::stderr();
154 term.write_line("nostr: fetching...")?; 154 term.write_line("nostr: fetching...")?;
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index c0085bd..15adc13 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -32,7 +32,7 @@ use ngit::{
32}; 32};
33use nostr::nips::nip10::Marker; 33use nostr::nips::nip10::Marker;
34use nostr_sdk::{ 34use nostr_sdk::{
35 Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, RelayUrl, Tag, 35 Event, EventBuilder, EventId, Kind, NostrSigner, PublicKey, RelayUrl, Tag, TagStandard,
36 hashes::sha1::Hash as Sha1Hash, 36 hashes::sha1::Hash as Sha1Hash,
37}; 37};
38use repo_ref::RepoRef; 38use repo_ref::RepoRef;
@@ -1312,7 +1312,13 @@ async fn create_merge_status(
1312 repo_ref 1312 repo_ref
1313 .coordinates() 1313 .coordinates()
1314 .iter() 1314 .iter()
1315 .map(|c| Tag::coordinate(c.clone())) 1315 .map(|c| {
1316 Tag::from_standardized(TagStandard::Coordinate {
1317 coordinate: c.coordinate.clone(),
1318 relay_url: c.relays.first().cloned(),
1319 uppercase: false,
1320 })
1321 })
1316 .collect::<Vec<Tag>>(), 1322 .collect::<Vec<Tag>>(),
1317 vec![ 1323 vec![
1318 Tag::from_standardized(nostr::TagStandard::Reference( 1324 Tag::from_standardized(nostr::TagStandard::Reference(
@@ -1358,7 +1364,7 @@ async fn get_proposal_and_revision_root_from_patch(
1358 patch.clone() 1364 patch.clone()
1359 } else { 1365 } else {
1360 let proposal_or_revision_id = EventId::parse( 1366 let proposal_or_revision_id = EventId::parse(
1361 if let Some(t) = patch.tags.iter().find(|t| t.is_root()) { 1367 &if let Some(t) = patch.tags.iter().find(|t| t.is_root()) {
1362 t.clone() 1368 t.clone()
1363 } else if let Some(t) = patch.tags.iter().find(|t| t.is_reply()) { 1369 } else if let Some(t) = patch.tags.iter().find(|t| t.is_reply()) {
1364 t.clone() 1370 t.clone()
@@ -1389,13 +1395,12 @@ async fn get_proposal_and_revision_root_from_patch(
1389 { 1395 {
1390 Ok(( 1396 Ok((
1391 EventId::parse( 1397 EventId::parse(
1392 proposal_or_revision 1398 &proposal_or_revision
1393 .tags 1399 .tags
1394 .iter() 1400 .iter()
1395 .find(|t| t.is_reply()) 1401 .find(|t| t.is_reply())
1396 .unwrap() 1402 .unwrap()
1397 .as_slice()[1] 1403 .as_slice()[1],
1398 .clone(),
1399 )?, 1404 )?,
1400 Some(proposal_or_revision.id), 1405 Some(proposal_or_revision.id),
1401 )) 1406 ))