`--ref` is similar to `--branch`, but was renamed as it also supports tags for example.
Showing the changes to src (2 of 3 files). Show all
Unified · Split
| @@ -404,6 +404,7 @@ pub fn main() -> Result<()> { · 403 unmodified lines | ||
| 404 | 404 | handshake_info, |
| 405 | 405 | bare, |
| 406 | 406 | no_tags, |
| 407 | + ref_name, | |
| 407 | 408 | remote, |
| 408 | 409 | shallow, |
| 409 | 410 | directory, |
| @@ -413,6 +414,7 @@ pub fn main() -> Result<()> { · 3 unmodified lines | ||
| 413 | 414 | bare, |
| 414 | 415 | handshake_info, |
| 415 | 416 | no_tags, |
| 417 | + ref_name, | |
| 416 | 418 | shallow: shallow.into(), |
| 417 | 419 | }; |
| 418 | 420 | prepare_and_run( |
| @@ -434,6 +434,10 @@ pub mod clone { · 433 unmodified lines | ||
| 434 | 434 | /// The url of the remote to connect to, like `https://github.com/byron/gitoxide`. |
| 435 | 435 | pub remote: OsString, |
| 436 | 436 | |
| 437 | + /// The name of the reference to check out. | |
| 438 | + #[clap(long = "ref", value_parser = crate::shared::AsPartialRefName, value_name = "REF_NAME")] | |
| 439 | + pub ref_name: Option<gix::refs::PartialName>, | |
| 440 | + | |
| 437 | 441 | /// The directory to initialize with the new repository and to which all data should be written. |
| 438 | 442 | pub directory: Option<PathBuf>, |
| 439 | 443 | } |