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 gitoxide-core/src (1 of 3 files). Show all

Unified · Split

gitoxide-core/src/repository/clone.rs+3−0
@@ -6,6 +6,7 @@ pub struct Options { · 5 unmodified lines
66 pub handshake_info: bool,
77 pub no_tags: bool,
88 pub shallow: gix::remote::fetch::Shallow,
9+ pub ref_name: Option<gix::refs::PartialName>,
910 }
1011
1112 pub const PROGRESS_RANGE: std::ops::RangeInclusive<u8> = 1..=3;
@@ -31,6 +32,7 @@ pub(crate) mod function { · 19 unmodified lines
3132 handshake_info,
3233 bare,
3334 no_tags,
35+ ref_name,
3436 shallow,
3537 }: Options,
3638 ) -> anyhow::Result<()>
@@ -75,6 +77,7 @@ pub(crate) mod function { · 38 unmodified lines
7577 }
7678 let (mut checkout, fetch_outcome) = prepare
7779 .with_shallow(shallow)
80+ .with_ref_name(ref_name.as_ref())?
7881 .fetch_then_checkout(&mut progress, &gix::interrupt::IS_INTERRUPTED)?;
7982
8083 let (repo, outcome) = if bare {

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