History

feat!: remove `gix remote --url` in favor of determining the intention similar to `git fetch` (#450)

Sebastian Thiel committed 4 years ago

Commit 92bbe331 parent 8c7351c4 files · +22 −35Browse files

Showing the changes to src (2 of 4 files). Show all

Unified · Split

2 files
  1. src/plumbing/main.rs +2 −6
  2. src/plumbing/options/mod.rs +2 −10
src/plumbing/main.rs+2−6
@@ -118,14 +118,12 @@ pub fn main() -> Result<()> { · 117 unmodified lines
118118 dry_run,
119119 remote,
120120 ref_spec,
121− url,
122121 }) => {
123122 let opts = core::repository::fetch::Options {
124123 format,
125124 dry_run,
126125 remote,
127126 ref_specs: ref_spec,
128− url,
129127 };
130128 prepare_and_run(
131129 "fetch",
@@ -150,7 +148,6 @@ pub fn main() -> Result<()> { · 18 unmodified lines
150148 #[cfg_attr(feature = "small", allow(unused_variables))]
151149 Subcommands::Remote(remote::Platform {
152150 name,
153− url,
154151 cmd,
155152 handshake_info,
156153 }) => match cmd {
@@ -162,9 +159,8 @@ pub fn main() -> Result<()> { · 5 unmodified lines
162159 core::repository::remote::refs::Kind::Tracking { ref_specs: ref_spec }
163160 }
164161 };
165− let context = core::repository::remote::refs::Context {
166− name,
167− url,
162+ let context = core::repository::remote::refs::Options {
163+ name_or_url: name,
168164 format,
169165 handshake_info,
170166 };
src/plumbing/options/mod.rs+2−10
@@ -123,16 +123,12 @@ pub mod fetch { · 122 unmodified lines
123123 #[clap(long, short = 'n')]
124124 pub dry_run: bool,
125125
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.
127127 ///
128128 /// If unset, the current branch will determine the remote.
129129 #[clap(long, short = 'r')]
130130 pub remote: Option<String>,
131131
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−
136132 /// Override the built-in and configured ref-specs with one or more of the given ones.
137133 #[clap(parse(try_from_os_str = git::env::os_str_to_bstring))]
138134 pub ref_spec: Vec<git_repository::bstr::BString>,
@@ -144,16 +140,12 @@ pub mod remote { · 5 unmodified lines
144140
145141 #[derive(Debug, clap::Parser)]
146142 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.
148144 ///
149145 /// If unset, the current branch will determine the remote.
150146 #[clap(long, short = 'n')]
151147 pub name: Option<String>,
152148
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−
157149 /// Output additional typically information provided by the server as part of the connection handshake.
158150 #[clap(long)]
159151 pub handshake_info: bool,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t