History

feat: `gix clone` with `--ref` support.

`--ref` is similar to `--branch`, but was renamed as it also supports tags for example.

Sebastian Thiel committed 2 years ago

Commit 9bf01e41 parent acbfa6f3 files · +9 −0Browse files

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

Unified · Split

2 files
  1. src/plumbing/main.rs +2 −0
  2. src/plumbing/options/mod.rs +4 −0
src/plumbing/main.rs+2−0
@@ -404,6 +404,7 @@ pub fn main() -> Result<()> { · 403 unmodified lines
404404 handshake_info,
405405 bare,
406406 no_tags,
407+ ref_name,
407408 remote,
408409 shallow,
409410 directory,
@@ -413,6 +414,7 @@ pub fn main() -> Result<()> { · 3 unmodified lines
413414 bare,
414415 handshake_info,
415416 no_tags,
417+ ref_name,
416418 shallow: shallow.into(),
417419 };
418420 prepare_and_run(
src/plumbing/options/mod.rs+4−0
@@ -434,6 +434,10 @@ pub mod clone { · 433 unmodified lines
434434 /// The url of the remote to connect to, like `https://github.com/byron/gitoxide`.
435435 pub remote: OsString,
436436
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+
437441 /// The directory to initialize with the new repository and to which all data should be written.
438442 pub directory: Option<PathBuf>,
439443 }