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.rs20
-rw-r--r--src/sub_commands/send.rs14
2 files changed, 30 insertions, 4 deletions
diff --git a/src/git_remote_helper.rs b/src/git_remote_helper.rs
index 6997dfa..97db69a 100644
--- a/src/git_remote_helper.rs
+++ b/src/git_remote_helper.rs
@@ -814,8 +814,24 @@ async fn push(
814 rejected_proposal_refspecs.push(refspec.to_string()); 814 rejected_proposal_refspecs.push(refspec.to_string());
815 } 815 }
816 } else { 816 } else {
817 // TODO new proposal / proposal no longer open 817 // TODO new proposal / couldn't find exisiting proposal
818 // / we couldn't 818 let (_, main_tip) = git_repo.get_main_or_master_branch()?;
819 let (mut ahead, _) =
820 git_repo.get_commits_ahead_behind(&main_tip, &tip_of_pushed_branch)?;
821 ahead.reverse();
822 for patch in generate_cover_letter_and_patch_events(
823 None,
824 git_repo,
825 &ahead,
826 &signer,
827 repo_ref,
828 &None,
829 &[],
830 )
831 .await?
832 {
833 events.push(patch);
834 }
819 } 835 }
820 } 836 }
821 } 837 }
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs
index f492734..a005bd7 100644
--- a/src/sub_commands/send.rs
+++ b/src/sub_commands/send.rs
@@ -648,7 +648,11 @@ 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![branch_name], 651 vec![if let Some(branch_name) = branch_name.strip_prefix("prs/") {
652 branch_name.to_string()
653 } else {
654 branch_name
655 }],
652 ), 656 ),
653 ] 657 ]
654 } 658 }
@@ -687,7 +691,13 @@ pub async fn generate_cover_letter_and_patch_events(
687 && !branch_name.eq("origin/main") 691 && !branch_name.eq("origin/main")
688 && !branch_name.eq("origin/master") 692 && !branch_name.eq("origin/master")
689 { 693 {
690 Some(branch_name) 694 Some(
695 if let Some(branch_name) = branch_name.strip_prefix("prs/") {
696 branch_name.to_string()
697 } else {
698 branch_name
699 },
700 )
691 } else { 701 } else {
692 None 702 None
693 } 703 }