mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 22:10:31 +08:00
radicle: custom upstream remote for patches
When creating a new upstream for the patch workflow, the remote name is always assumed to be `rad`. It's possible for users to use another remote name but still use a `rad://` URL for pushing. To allow for this, the function that creates the upstream entry now takes a remote name. In the remote helper, `rad patch checkout`, and `rad patch set` the remote can be optionally specified and fall back to the `rad` remote name as a default. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -14,6 +14,7 @@ use crate::terminal as term;
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Options {
|
||||
pub name: Option<RefString>,
|
||||
pub remote: Option<RefString>,
|
||||
pub force: bool,
|
||||
}
|
||||
|
||||
@@ -97,7 +98,13 @@ pub fn run(
|
||||
));
|
||||
spinner.finish();
|
||||
|
||||
if let Some(branch) = rad::setup_patch_upstream(patch_id, revision.head(), working, false)? {
|
||||
if let Some(branch) = rad::setup_patch_upstream(
|
||||
patch_id,
|
||||
revision.head(),
|
||||
working,
|
||||
opts.remote.as_ref().unwrap_or(&radicle::rad::REMOTE_NAME),
|
||||
false,
|
||||
)? {
|
||||
let tracking = branch
|
||||
.name()?
|
||||
.ok_or_else(|| anyhow!("failed to create tracking branch: invalid name"))?;
|
||||
|
||||
Reference in New Issue
Block a user