From 5618fd9883d45de1443a40abada944cbe3bb8dfd Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Aug 2024 08:35:53 +0100 Subject: feat(remote): `push` new proposal issue new proposal when new branch is pushed into `prs/*` namespace, which doesn't match an existing proposal --- src/git_remote_helper.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/git_remote_helper.rs') 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( rejected_proposal_refspecs.push(refspec.to_string()); } } else { - // TODO new proposal / proposal no longer open - // / we couldn't + // TODO new proposal / couldn't find exisiting proposal + let (_, main_tip) = git_repo.get_main_or_master_branch()?; + let (mut ahead, _) = + git_repo.get_commits_ahead_behind(&main_tip, &tip_of_pushed_branch)?; + ahead.reverse(); + for patch in generate_cover_letter_and_patch_events( + None, + git_repo, + &ahead, + &signer, + repo_ref, + &None, + &[], + ) + .await? + { + events.push(patch); + } } } } -- cgit v1.2.3