upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/git_remote_nostr/push.rs1
-rw-r--r--src/bin/ngit/sub_commands/send.rs14
2 files changed, 14 insertions, 1 deletions
diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs
index 4552b91..f98e792 100644
--- a/src/bin/git_remote_nostr/push.rs
+++ b/src/bin/git_remote_nostr/push.rs
@@ -482,6 +482,7 @@ async fn generate_patches_or_pr_event_or_pr_updates(
482 root_proposal, 482 root_proposal,
483 &None, 483 &None,
484 &repo_grasp_clone_urls, 484 &repo_grasp_clone_urls,
485 None,
485 signer, 486 signer,
486 term, 487 term,
487 ) 488 )
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs
index 69ad1e6..609812b 100644
--- a/src/bin/ngit/sub_commands/send.rs
+++ b/src/bin/ngit/sub_commands/send.rs
@@ -208,6 +208,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
208 } 208 }
209 let mut to_try = repo_grasp_clone_urls.clone(); 209 let mut to_try = repo_grasp_clone_urls.clone();
210 let mut tried = vec![]; 210 let mut tried = vec![];
211 let mut git_ref = None;
211 loop { 212 loop {
212 let (events, _server_responses) = push_refs_and_generate_pr_or_pr_update_event( 213 let (events, _server_responses) = push_refs_and_generate_pr_or_pr_update_event(
213 &git_repo, 214 &git_repo,
@@ -217,6 +218,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
217 root_proposal.as_ref(), 218 root_proposal.as_ref(),
218 &cover_letter_title_description, 219 &cover_letter_title_description,
219 &repo_grasp_clone_urls, 220 &repo_grasp_clone_urls,
221 git_ref.clone(),
220 &signer, 222 &signer,
221 &console::Term::stdout(), 223 &console::Term::stdout(),
222 ) 224 )
@@ -235,7 +237,17 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
235 .clone(); 237 .clone();
236 if CloneUrl::from_str(&clone_url).is_ok() { 238 if CloneUrl::from_str(&clone_url).is_ok() {
237 to_try.push(clone_url); 239 to_try.push(clone_url);
238 // TODO customise ref to push 240 let mut git_ref_or_branch_name = Interactor::default()
241 .input(
242 PromptInputParms::default()
243 .with_prompt("ref / branch name")
244 .with_default(git_ref.unwrap_or("refs/nostr/<event-id>".to_string())),
245 )?
246 .clone();
247 if !git_ref_or_branch_name.starts_with("refs/") {
248 git_ref_or_branch_name = format!("refs/heads/{git_ref_or_branch_name}");
249 }
250 git_ref = Some(git_ref_or_branch_name);
239 } else { 251 } else {
240 println!("invalid clone url"); 252 println!("invalid clone url");
241 } 253 }