upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/git_remote_helper.rs10
-rw-r--r--src/sub_commands/send.rs16
2 files changed, 12 insertions, 14 deletions
diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs
index 9b9b000..e55a2eb 100644
--- a/src/git_remote_helper.rs
+++ b/src/git_remote_helper.rs
@@ -233,7 +233,7 @@ async fn list(
233 .clone() 233 .clone()
234 }; 234 };
235 235
236 state.retain(|k, _| !k.starts_with("refs/heads/prs/")); 236 state.retain(|k, _| !k.starts_with("refs/heads/pr/"));
237 237
238 let open_proposals = get_open_proposals(git_repo, repo_ref).await?; 238 let open_proposals = get_open_proposals(git_repo, repo_ref).await?;
239 let current_user = get_curent_user(git_repo)?; 239 let current_user = get_curent_user(git_repo)?;
@@ -447,7 +447,7 @@ async fn fetch(
447 447
448 let oids_from_git_servers = fetch_batch 448 let oids_from_git_servers = fetch_batch
449 .iter() 449 .iter()
450 .filter(|(refstr, _)| !refstr.contains("refs/heads/prs/")) 450 .filter(|(refstr, _)| !refstr.contains("refs/heads/pr/"))
451 .map(|(_, oid)| oid.clone()) 451 .map(|(_, oid)| oid.clone())
452 .collect::<Vec<String>>(); 452 .collect::<Vec<String>>();
453 453
@@ -488,7 +488,7 @@ async fn fetch(
488 ); 488 );
489 } 489 }
490 490
491 fetch_batch.retain(|refstr, _| refstr.contains("refs/heads/prs/")); 491 fetch_batch.retain(|refstr, _| refstr.contains("refs/heads/pr/"));
492 492
493 if !fetch_batch.is_empty() { 493 if !fetch_batch.is_empty() {
494 let open_proposals = get_open_proposals(git_repo, repo_ref).await?; 494 let open_proposals = get_open_proposals(git_repo, repo_ref).await?;
@@ -580,13 +580,13 @@ async fn push(
580 580
581 let proposal_refspecs = refspecs 581 let proposal_refspecs = refspecs
582 .iter() 582 .iter()
583 .filter(|r| r.contains("refs/heads/prs/")) 583 .filter(|r| r.contains("refs/heads/pr/"))
584 .cloned() 584 .cloned()
585 .collect::<Vec<String>>(); 585 .collect::<Vec<String>>();
586 586
587 let mut git_server_refspecs = refspecs 587 let mut git_server_refspecs = refspecs
588 .iter() 588 .iter()
589 .filter(|r| !r.contains("refs/heads/prs/")) 589 .filter(|r| !r.contains("refs/heads/pr/"))
590 .cloned() 590 .cloned()
591 .collect::<Vec<String>>(); 591 .collect::<Vec<String>>();
592 592
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index a005bd7..8369b10 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -648,7 +648,7 @@ pub async fn generate_cover_letter_and_patch_events(
648 vec![ 648 vec![
649 Tag::custom( 649 Tag::custom(
650 nostr::TagKind::Custom(std::borrow::Cow::Borrowed("branch-name")), 650 nostr::TagKind::Custom(std::borrow::Cow::Borrowed("branch-name")),
651 vec![if let Some(branch_name) = branch_name.strip_prefix("prs/") { 651 vec![if let Some(branch_name) = branch_name.strip_prefix("pr/") {
652 branch_name.to_string() 652 branch_name.to_string()
653 } else { 653 } else {
654 branch_name 654 branch_name
@@ -691,13 +691,11 @@ pub async fn generate_cover_letter_and_patch_events(
691 && !branch_name.eq("origin/main") 691 && !branch_name.eq("origin/main")
692 && !branch_name.eq("origin/master") 692 && !branch_name.eq("origin/master")
693 { 693 {
694 Some( 694 Some(if let Some(branch_name) = branch_name.strip_prefix("pr/") {
695 if let Some(branch_name) = branch_name.strip_prefix("prs/") { 695 branch_name.to_string()
696 branch_name.to_string() 696 } else {
697 } else { 697 branch_name
698 branch_name 698 })
699 },
700 )
701 } else { 699 } else {
702 None 700 None
703 } 701 }
@@ -793,7 +791,7 @@ pub struct CoverLetter {
793impl CoverLetter { 791impl CoverLetter {
794 pub fn get_branch_name(&self) -> Result<String> { 792 pub fn get_branch_name(&self) -> Result<String> {
795 Ok(format!( 793 Ok(format!(
796 "prs/{}({})", 794 "pr/{}({})",
797 self.branch_name, 795 self.branch_name,
798 &self 796 &self
799 .event_id 797 .event_id