upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/push.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/push.rs')
-rw-r--r--src/bin/git_remote_nostr/push.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index 441c341..2c9c7e1 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -15,7 +15,7 @@ use git_events::{
15}; 15};
16use ngit::{ 16use ngit::{
17 client::{self, get_event_from_cache_by_id}, 17 client::{self, get_event_from_cache_by_id},
18 git, 18 git::{self, nostr_url::NostrUrlDecoded},
19 git_events::{self, get_event_root}, 19 git_events::{self, get_event_root},
20 login::{self, get_curent_user}, 20 login::{self, get_curent_user},
21 repo_ref, repo_state, 21 repo_ref, repo_state,
@@ -42,7 +42,7 @@ use crate::{
42pub async fn run_push( 42pub async fn run_push(
43 git_repo: &Repo, 43 git_repo: &Repo,
44 repo_ref: &RepoRef, 44 repo_ref: &RepoRef,
45 nostr_remote_url: &str, 45 decoded_nostr_url: &NostrUrlDecoded,
46 stdin: &Stdin, 46 stdin: &Stdin,
47 initial_refspec: &str, 47 initial_refspec: &str,
48 client: &Client, 48 client: &Client,
@@ -66,7 +66,7 @@ pub async fn run_push(
66 66
67 let list_outputs = match list_outputs { 67 let list_outputs = match list_outputs {
68 Some(outputs) => outputs, 68 Some(outputs) => outputs,
69 _ => list_from_remotes(&term, git_repo, &repo_ref.git_server)?, 69 _ => list_from_remotes(&term, git_repo, &repo_ref.git_server, decoded_nostr_url),
70 }; 70 };
71 71
72 let nostr_state = get_state_from_cache(git_repo.get_path()?, repo_ref).await; 72 let nostr_state = get_state_from_cache(git_repo.get_path()?, repo_ref).await;
@@ -154,7 +154,7 @@ pub async fn run_push(
154 &term, 154 &term,
155 repo_ref, 155 repo_ref,
156 git_repo, 156 git_repo,
157 nostr_remote_url, 157 &decoded_nostr_url.original_string,
158 &signer, 158 &signer,
159 &git_server_refspecs, 159 &git_server_refspecs,
160 ) 160 )
@@ -306,8 +306,12 @@ pub async fn run_push(
306 } 306 }
307 let (_, to) = refspec_to_from_to(refspec)?; 307 let (_, to) = refspec_to_from_to(refspec)?;
308 println!("ok {to}"); 308 println!("ok {to}");
309 update_remote_refs_pushed(&git_repo.git_repo, refspec, nostr_remote_url) 309 update_remote_refs_pushed(
310 .context("could not update remote_ref locally")?; 310 &git_repo.git_repo,
311 refspec,
312 &decoded_nostr_url.original_string,
313 )
314 .context("could not update remote_ref locally")?;
311 } 315 }
312 316
313 // TODO make async - check gitlib2 callbacks work async 317 // TODO make async - check gitlib2 callbacks work async