upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands/push.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-23 16:36:06 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-23 16:36:06 +0100
commitb67376ff54abeab31422921ba5f4883d5d3dccdb (patch)
treed4f4194fdf2d285332dd7aacea31678042389b00 /src/sub_commands/push.rs
parent643fa17fde858c2d6f934dcc435eb84843cc172e (diff)
feat(list): unique proposal branch names
to prevent accidental name conflicts. also moved to prs/* namespace `pull` and `push` integration tests are intermitantly failing to end at least for `push` they work when run individually but not when run together
Diffstat (limited to 'src/sub_commands/push.rs')
-rw-r--r--src/sub_commands/push.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sub_commands/push.rs b/src/sub_commands/push.rs
index d05158f..9af8b40 100644
--- a/src/sub_commands/push.rs
+++ b/src/sub_commands/push.rs
@@ -16,7 +16,7 @@ use crate::{
16 get_most_recent_patch_with_ancestors, get_proposals_and_revisions_from_cache, 16 get_most_recent_patch_with_ancestors, get_proposals_and_revisions_from_cache,
17 tag_value, 17 tag_value,
18 }, 18 },
19 send::{event_to_cover_letter, generate_patch_event, send_events}, 19 send::{event_is_revision_root, event_to_cover_letter, generate_patch_event, send_events},
20 }, 20 },
21 Cli, 21 Cli,
22}; 22};
@@ -66,7 +66,11 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
66 get_proposals_and_revisions_from_cache(git_repo_path, repo_ref.coordinates()) 66 get_proposals_and_revisions_from_cache(git_repo_path, repo_ref.coordinates())
67 .await? 67 .await?
68 .iter() 68 .iter()
69 .find(|e| event_to_cover_letter(e).is_ok_and(|cl| cl.branch_name.eq(&branch_name))) 69 .find(|e| {
70 event_to_cover_letter(e)
71 .is_ok_and(|cl| cl.get_branch_name().is_ok_and(|s| s.eq(&branch_name)))
72 && !event_is_revision_root(e)
73 })
70 .context("cannot find proposal that matches the current branch name")? 74 .context("cannot find proposal that matches the current branch name")?
71 .clone(); 75 .clone();
72 76