upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-08-09 08:35:53 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-08-09 08:40:47 +0100
commit5618fd9883d45de1443a40abada944cbe3bb8dfd (patch)
tree98588d4e8ff29d8b0c2ea26d9450f4567d05754b /src/sub_commands
parent2ccf599bf787d4cc0012209ead2d07bb0eb7ffca (diff)
feat(remote): `push` new proposal
issue new proposal when new branch is pushed into `prs/*` namespace, which doesn't match an existing proposal
Diffstat (limited to 'src/sub_commands')
-rw-r--r--src/sub_commands/send.rs14
1 files changed, 12 insertions, 2 deletions
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 }