diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-09 08:35:53 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-08-09 08:40:47 +0100 |
| commit | 5618fd9883d45de1443a40abada944cbe3bb8dfd (patch) | |
| tree | 98588d4e8ff29d8b0c2ea26d9450f4567d05754b /src/git_remote_helper.rs | |
| parent | 2ccf599bf787d4cc0012209ead2d07bb0eb7ffca (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/git_remote_helper.rs')
| -rw-r--r-- | src/git_remote_helper.rs | 20 |
1 files changed, 18 insertions, 2 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 | } |