From 29f61ffdf155ea88b8d9aec23d28cf70baba577e Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 5 Aug 2025 11:38:09 +0100 Subject: feat(send): custom ref for PR clone url allow specifying ref for pushing PR to custom clone url --- src/lib/push.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/push.rs b/src/lib/push.rs index 4c2d8f1..c202397 100644 --- a/src/lib/push.rs +++ b/src/lib/push.rs @@ -330,6 +330,7 @@ pub async fn push_refs_and_generate_pr_or_pr_update_event( root_proposal: Option<&Event>, title_description_overide: &Option<(String, String)>, servers: &[String], + git_ref: Option, signer: &Arc, term: &Term, ) -> Result<(Option>, Vec<(String, Result<()>)>)> { @@ -352,7 +353,12 @@ pub async fn push_refs_and_generate_pr_or_pr_update_event( )? }; - let refspec = format!("{}:refs/nostr/{}", tip, draft_pr_event.id()); + let git_ref_used = git_ref + .clone() + .unwrap_or("refs/nostr/".to_string()) + .replace("", &draft_pr_event.id().to_string()); + + let refspec = format!("{tip}:{git_ref_used}"); if let Err(error) = push_to_remote_url(git_repo, clone_url, &[refspec], term) { term.write_line( -- cgit v1.2.3