diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-20 06:25:17 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-20 06:25:17 +0100 |
| commit | fedf5166f0c57db14b9e43747121e4b7845b63dd (patch) | |
| tree | 0bcbcc200239b75180931f6d5d6d76ee6ace1bf6 /src/sub_commands/send.rs | |
| parent | 42b0bad048b64ef51f45da6a6988823e5a49da1d (diff) | |
feat: set proposal branch prefix to `pr/`
from `prs/`.
whilst plural reflects usage of `heads` and `tags` in git refs,
singular is shorter and more reflective of usage of branch prefixes
such as `feature/` `fix/`
Diffstat (limited to 'src/sub_commands/send.rs')
| -rw-r--r-- | src/sub_commands/send.rs | 16 |
1 files changed, 7 insertions, 9 deletions
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 { | |||
| 793 | impl CoverLetter { | 791 | impl 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 |