Skip to content

Commit 91f193f

Browse files
committed
change!: fetch::Ref::unpack() returns &BStr instead of &BString as ref name. (#450)
1 parent 06d45ff commit 91f193f

File tree

1 file changed

+4
-4
lines changed
  • git-protocol/src/fetch/refs

1 file changed

+4
-4
lines changed

git-protocol/src/fetch/refs/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bstr::BString;
1+
use bstr::{BStr, BString};
22

33
mod error {
44
use crate::fetch::refs::parse;
@@ -81,17 +81,17 @@ impl Ref {
8181
/// Provide shared fields referring to the ref itself, namely `(name, target, [peeled])`.
8282
/// In case of peeled refs, the tag object itself is returned as it is what the ref directly refers to, and target of the tag is returned
8383
/// as `peeled`.
84-
pub fn unpack(&self) -> (&BString, &git_hash::oid, Option<&git_hash::oid>) {
84+
pub fn unpack(&self) -> (&BStr, &git_hash::oid, Option<&git_hash::oid>) {
8585
match self {
8686
Ref::Direct { full_ref_name, object }
8787
| Ref::Symbolic {
8888
full_ref_name, object, ..
89-
} => (full_ref_name, object, None),
89+
} => (full_ref_name.as_ref(), object, None),
9090
Ref::Peeled {
9191
full_ref_name,
9292
tag: object,
9393
object: peeled,
94-
} => (full_ref_name, object, Some(peeled)),
94+
} => (full_ref_name.as_ref(), object, Some(peeled)),
9595
}
9696
}
9797
}

0 commit comments

Comments
 (0)