upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/git_remote_nostr/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/git_remote_nostr/main.rs')
-rw-r--r--src/bin/git_remote_nostr/main.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/bin/git_remote_nostr/main.rs b/src/bin/git_remote_nostr/main.rs
index e6f7af3..44359dd 100644
--- a/src/bin/git_remote_nostr/main.rs
+++ b/src/bin/git_remote_nostr/main.rs
@@ -53,9 +53,11 @@ async fn main() -> Result<()> {
53 53
54 fetching_with_report_for_helper(git_repo_path, &client, &decoded_nostr_url.coordinate).await?; 54 fetching_with_report_for_helper(git_repo_path, &client, &decoded_nostr_url.coordinate).await?;
55 55
56 let repo_ref = 56 let mut repo_ref =
57 get_repo_ref_from_cache(Some(git_repo_path), &decoded_nostr_url.coordinate).await?; 57 get_repo_ref_from_cache(Some(git_repo_path), &decoded_nostr_url.coordinate).await?;
58 58
59 repo_ref.set_nostr_git_url(decoded_nostr_url.clone());
60
59 let stdin = io::stdin(); 61 let stdin = io::stdin();
60 let mut line = String::new(); 62 let mut line = String::new();
61 63
@@ -77,21 +79,12 @@ async fn main() -> Result<()> {
77 println!("unsupported"); 79 println!("unsupported");
78 } 80 }
79 ["fetch", oid, refstr] => { 81 ["fetch", oid, refstr] => {
80 fetch::run_fetch( 82 fetch::run_fetch(&git_repo, &repo_ref, &stdin, oid, refstr).await?;
81 &git_repo,
82 &repo_ref,
83 &decoded_nostr_url,
84 &stdin,
85 oid,
86 refstr,
87 )
88 .await?;
89 } 83 }
90 ["push", refspec] => { 84 ["push", refspec] => {
91 push::run_push( 85 push::run_push(
92 &git_repo, 86 &git_repo,
93 &repo_ref, 87 &repo_ref,
94 &decoded_nostr_url,
95 &stdin, 88 &stdin,
96 refspec, 89 refspec,
97 &client, 90 &client,
@@ -100,12 +93,10 @@ async fn main() -> Result<()> {
100 .await?; 93 .await?;
101 } 94 }
102 ["list"] => { 95 ["list"] => {
103 list_outputs = 96 list_outputs = Some(list::run_list(&git_repo, &repo_ref, false).await?);
104 Some(list::run_list(&git_repo, &repo_ref, &decoded_nostr_url, false).await?);
105 } 97 }
106 ["list", "for-push"] => { 98 ["list", "for-push"] => {
107 list_outputs = 99 list_outputs = Some(list::run_list(&git_repo, &repo_ref, true).await?);
108 Some(list::run_list(&git_repo, &repo_ref, &decoded_nostr_url, true).await?);
109 } 100 }
110 [] => { 101 [] => {
111 return Ok(()); 102 return Ok(());