Showing the changes to src (2 of 4 files). Show all
Unified · Split
| @@ -118,14 +118,12 @@ pub fn main() -> Result<()> { · 117 unmodified lines | |||
| 118 | dry_run, | 118 | dry_run, |
| 119 | remote, | 119 | remote, |
| 120 | ref_spec, | 120 | ref_spec, |
| 121 | url, | ||
| 122 | }) => { | 121 | }) => { |
| 123 | let opts = core::repository::fetch::Options { | 122 | let opts = core::repository::fetch::Options { |
| 124 | format, | 123 | format, |
| 125 | dry_run, | 124 | dry_run, |
| 126 | remote, | 125 | remote, |
| 127 | ref_specs: ref_spec, | 126 | ref_specs: ref_spec, |
| 128 | url, | ||
| 129 | }; | 127 | }; |
| 130 | prepare_and_run( | 128 | prepare_and_run( |
| 131 | "fetch", | 129 | "fetch", |
| @@ -150,7 +148,6 @@ pub fn main() -> Result<()> { · 18 unmodified lines | |||
| 150 | #[cfg_attr(feature = "small", allow(unused_variables))] | 148 | #[cfg_attr(feature = "small", allow(unused_variables))] |
| 151 | Subcommands::Remote(remote::Platform { | 149 | Subcommands::Remote(remote::Platform { |
| 152 | name, | 150 | name, |
| 153 | url, | ||
| 154 | cmd, | 151 | cmd, |
| 155 | handshake_info, | 152 | handshake_info, |
| 156 | }) => match cmd { | 153 | }) => match cmd { |
| @@ -162,9 +159,8 @@ pub fn main() -> Result<()> { · 5 unmodified lines | |||
| 162 | core::repository::remote::refs::Kind::Tracking { ref_specs: ref_spec } | 159 | core::repository::remote::refs::Kind::Tracking { ref_specs: ref_spec } |
| 163 | } | 160 | } |
| 164 | }; | 161 | }; |
| 165 | let context = core::repository::remote::refs::Context { | 162 | let context = core::repository::remote::refs::Options { |
| 166 | name, | 163 | name_or_url: name, |
| 167 | url, | ||
| 168 | format, | 164 | format, |
| 169 | handshake_info, | 165 | handshake_info, |
| 170 | }; | 166 | }; |
| @@ -123,16 +123,12 @@ pub mod fetch { · 122 unmodified lines | |||
| 123 | #[clap(long, short = 'n')] | 123 | #[clap(long, short = 'n')] |
| 124 | pub dry_run: bool, | 124 | pub dry_run: bool, |
| 125 | 125 | ||
| 126 | /// The name of the remote to connect to. | 126 | /// The name of the remote to connect to, or the url of the remote to connect to directly. |
| 127 | /// | 127 | /// |
| 128 | /// If unset, the current branch will determine the remote. | 128 | /// If unset, the current branch will determine the remote. |
| 129 | #[clap(long, short = 'r')] | 129 | #[clap(long, short = 'r')] |
| 130 | pub remote: Option<String>, | 130 | pub remote: Option<String>, |
| 131 | 131 | ||
| 132 | /// Connect directly to the given URL, forgoing any configuration from the repository. | ||
| 133 | #[clap(long, short = 'u', conflicts_with("remote"), parse(try_from_os_str = std::convert::TryFrom::try_from))] | ||
| 134 | pub url: Option<git::Url>, | ||
| 135 | |||
| 136 | /// Override the built-in and configured ref-specs with one or more of the given ones. | 132 | /// Override the built-in and configured ref-specs with one or more of the given ones. |
| 137 | #[clap(parse(try_from_os_str = git::env::os_str_to_bstring))] | 133 | #[clap(parse(try_from_os_str = git::env::os_str_to_bstring))] |
| 138 | pub ref_spec: Vec<git_repository::bstr::BString>, | 134 | pub ref_spec: Vec<git_repository::bstr::BString>, |
| @@ -144,16 +140,12 @@ pub mod remote { · 5 unmodified lines | |||
| 144 | 140 | ||
| 145 | #[derive(Debug, clap::Parser)] | 141 | #[derive(Debug, clap::Parser)] |
| 146 | pub struct Platform { | 142 | pub struct Platform { |
| 147 | /// The name of the remote to connect to. | 143 | /// The name of the remote to connect to, or the URL of the remote to connect to directly. |
| 148 | /// | 144 | /// |
| 149 | /// If unset, the current branch will determine the remote. | 145 | /// If unset, the current branch will determine the remote. |
| 150 | #[clap(long, short = 'n')] | 146 | #[clap(long, short = 'n')] |
| 151 | pub name: Option<String>, | 147 | pub name: Option<String>, |
| 152 | 148 | ||
| 153 | /// Connect directly to the given URL, forgoing any configuration from the repository. | ||
| 154 | #[clap(long, short = 'u', conflicts_with("name"), parse(try_from_os_str = std::convert::TryFrom::try_from))] | ||
| 155 | pub url: Option<git::Url>, | ||
| 156 | |||
| 157 | /// Output additional typically information provided by the server as part of the connection handshake. | 149 | /// Output additional typically information provided by the server as part of the connection handshake. |
| 158 | #[clap(long)] | 150 | #[clap(long)] |
| 159 | pub handshake_info: bool, | 151 | pub handshake_info: bool, |