Skip to content

Commit e29e952

Browse files
committed
docs: using PrepareFetch::with_ref_name with non-branch refs causes panics
#2309
1 parent d602d7e commit e29e952

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

gix/src/clone/access.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ impl PrepareFetch {
4848
///
4949
/// Note that `name` should be a partial name like `main` or `feat/one`, but can be a full ref name.
5050
/// If a branch on the remote matches, it will automatically be retrieved even without a refspec.
51+
///
52+
/// **Warning**: Calling this method with a valid refspec that is not a branch name currently causes
53+
/// subsequent calls to [`PrepareFetch::fetch_only`] or [`PrepareFetch::fetch_then_checkout`] to panic.
5154
pub fn with_ref_name<'a, Name, E>(mut self, name: Option<Name>) -> Result<Self, E>
5255
where
5356
Name: TryInto<&'a gix_ref::PartialNameRef, Error = E>,

0 commit comments

Comments
 (0)