Skip to content

Commit 7c59cf4

Browse files
authored
Merge pull request #2315 from decathorpe/main
docs: using PrepareFetch::with_ref_name with non-branch refs causes panics
2 parents d602d7e + 7d900a6 commit 7c59cf4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gix/src/clone/access.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ 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+
/// # Panics
53+
///
54+
/// Calling this method with a valid refspec that is not a branch name, like an object-id as hex-hash,
55+
/// currently causes subsequent calls to [`PrepareFetch::fetch_only`] or [`PrepareFetch::fetch_then_checkout`] to panic.
5156
pub fn with_ref_name<'a, Name, E>(mut self, name: Option<Name>) -> Result<Self, E>
5257
where
5358
Name: TryInto<&'a gix_ref::PartialNameRef, Error = E>,

0 commit comments

Comments
 (0)