File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
git-protocol/src/fetch/refs Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -78,21 +78,20 @@ pub enum Ref {
78
78
}
79
79
80
80
impl Ref {
81
- /// Provide shared fields referring to the ref itself, namely `(name, target)`.
82
- /// In case of peeled refs, the tag object itself is returned as it is what the ref directly refers to.
83
- pub fn unpack ( & self ) -> ( & BString , & git_hash:: oid ) {
81
+ /// Provide shared fields referring to the ref itself, namely `(name, target, [peeled])`.
82
+ /// 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
83
+ /// as `peeled`.
84
+ pub fn unpack ( & self ) -> ( & BString , & git_hash:: oid , Option < & git_hash:: oid > ) {
84
85
match self {
85
- Ref :: Direct {
86
+ Ref :: Direct { full_ref_name, object }
87
+ | Ref :: Symbolic {
86
88
full_ref_name, object, ..
87
- }
88
- | Ref :: Peeled {
89
+ } => ( full_ref_name , object , None ) ,
90
+ Ref :: Peeled {
89
91
full_ref_name,
90
92
tag : object,
91
- ..
92
- }
93
- | Ref :: Symbolic {
94
- full_ref_name, object, ..
95
- } => ( full_ref_name, object) ,
93
+ object : peeled,
94
+ } => ( full_ref_name, object, Some ( peeled) ) ,
96
95
}
97
96
}
98
97
}
You can’t perform that action at this time.
0 commit comments