upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/ngit/sub_commands/send.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs
index ba64f64..0e4a572 100644
--- a/src/bin/ngit/sub_commands/send.rs
+++ b/src/bin/ngit/sub_commands/send.rs
@@ -43,6 +43,12 @@ pub struct SubCommandArgs {
43 #[clap(short, long)] 43 #[clap(short, long)]
44 /// optional cover letter description 44 /// optional cover letter description
45 pub(crate) description: Option<String>, 45 pub(crate) description: Option<String>,
46 /// publish as Pull Request even if each commit is < 60kb
47 #[arg(long, action)]
48 pub(crate) force_pr: bool,
49 /// publish as Patches even if they may be > 60kb
50 #[arg(long, action)]
51 pub(crate) force_patch: bool,
46} 52}
47 53
48#[allow(clippy::too_many_lines)] 54#[allow(clippy::too_many_lines)]
@@ -116,7 +122,7 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
116 &main_tip, 122 &main_tip,
117 )?; 123 )?;
118 124
119 let as_pr = { 125 let should_be_pr = {
120 if let Some(root_proposal) = &root_proposal { 126 if let Some(root_proposal) = &root_proposal {
121 proposal_tip_is_pr_or_pr_update(git_repo_path, &repo_ref, &root_proposal.id).await? 127 proposal_tip_is_pr_or_pr_update(git_repo_path, &repo_ref, &root_proposal.id).await?
122 } else { 128 } else {
@@ -124,6 +130,14 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
124 } 130 }
125 } || git_repo.are_commits_too_big_for_patches(&commits); 131 } || git_repo.are_commits_too_big_for_patches(&commits);
126 132
133 let as_pr = if args.force_patch {
134 false
135 } else if args.force_pr {
136 true
137 } else {
138 should_be_pr
139 };
140
127 let title = if as_pr { 141 let title = if as_pr {
128 match &args.title { 142 match &args.title {
129 Some(t) => Some(t.clone()), 143 Some(t) => Some(t.clone()),