upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/sub_commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ngit/sub_commands')
-rw-r--r--src/bin/ngit/sub_commands/send.rs38
-rw-r--r--src/bin/ngit/sub_commands/sync.rs1
2 files changed, 24 insertions, 15 deletions
diff --git a/src/bin/ngit/sub_commands/send.rs b/src/bin/ngit/sub_commands/send.rs
index 325ad89..6b18e84 100644
--- a/src/bin/ngit/sub_commands/send.rs
+++ b/src/bin/ngit/sub_commands/send.rs
@@ -50,6 +50,9 @@ pub struct SubCommandArgs {
50 /// publish as Patches even if they may be > 60kb 50 /// publish as Patches even if they may be > 60kb
51 #[arg(long, action)] 51 #[arg(long, action)]
52 pub(crate) force_patch: bool, 52 pub(crate) force_patch: bool,
53 #[clap(long = "push-option", short = 'o', value_parser, num_args = 0..)]
54 /// git push options to pass to the git server (eg. -o secret-scanning.skip)
55 pub(crate) push_options: Vec<String>,
53} 56}
54 57
55/// Validates send command arguments for non-interactive mode. 58/// Validates send command arguments for non-interactive mode.
@@ -351,21 +354,26 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs, no_fetch: bool) -> Re
351 let events = if as_pr { 354 let events = if as_pr {
352 let tip = commits.last().context("no commits")?; // commits has been reversed to oldest first 355 let tip = commits.last().context("no commits")?; // commits has been reversed to oldest first
353 let first_commit = commits.first().context("no commits")?; 356 let first_commit = commits.first().context("no commits")?;
354 select_servers_push_refs_and_generate_pr_or_pr_update_event( 357 {
355 &client, 358 let push_options_refs: Vec<&str> =
356 &git_repo, 359 args.push_options.iter().map(String::as_str).collect();
357 &repo_ref, 360 select_servers_push_refs_and_generate_pr_or_pr_update_event(
358 tip, 361 &client,
359 first_commit, 362 &git_repo,
360 git_repo.get_commit_parent(first_commit).ok().as_ref(), 363 &repo_ref,
361 &mut user_ref, 364 tip,
362 root_proposal.as_ref(), 365 first_commit,
363 &cover_letter_title_description, 366 git_repo.get_commit_parent(first_commit).ok().as_ref(),
364 &signer, 367 &mut user_ref,
365 true, 368 root_proposal.as_ref(),
366 &console::Term::stdout(), 369 &cover_letter_title_description,
367 ) 370 &signer,
368 .await? 371 true,
372 &console::Term::stdout(),
373 &push_options_refs,
374 )
375 .await?
376 }
369 } else { 377 } else {
370 let events = generate_cover_letter_and_patch_events( 378 let events = generate_cover_letter_and_patch_events(
371 cover_letter_title_description.clone(), 379 cover_letter_title_description.clone(),
diff --git a/src/bin/ngit/sub_commands/sync.rs b/src/bin/ngit/sub_commands/sync.rs
index daebb1b..b377ab4 100644
--- a/src/bin/ngit/sub_commands/sync.rs
+++ b/src/bin/ngit/sub_commands/sync.rs
@@ -187,6 +187,7 @@ pub async fn launch(args: &SubCommandArgs) -> Result<()> {
187 &refspecs, 187 &refspecs,
188 &term, 188 &term,
189 *is_grasp_server || is_grasp_server_clone_url(url), 189 *is_grasp_server || is_grasp_server_clone_url(url),
190 &[],
190 ) { 191 ) {
191 Err(error) => { 192 Err(error) => {
192 term.write_line(&format!( 193 term.write_line(&format!(