…and not the one that refers to the (usually) commit the tags points to. When declaring wants, it really wants to see tips first, it appears. Quite tricky
Unified · Split
| @@ -54,10 +54,12 @@ pub enum Ref { · 53 unmodified lines | ||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | impl Ref { |
| 57 | − pub fn unpack_common(&self) -> (&BString, &owned::Id) { | |
| 57 | + /// Provide shared fields referring to the ref itself. In case of peeled refs, the tag object itself is returned as it is what | |
| 58 | + /// the path refers to. | |
| 59 | + pub fn unpack(&self) -> (&BString, &owned::Id) { | |
| 58 | 60 | match self { |
| 59 | 61 | Ref::Direct { path, object, .. } |
| 60 | − | Ref::Peeled { path, object, .. } | |
| 62 | + | Ref::Peeled { path, tag: object, .. } // the tag acts as reference | |
| 61 | 63 | | Ref::Symbolic { path, object, .. } => (path, object), |
| 62 | 64 | } |
| 63 | 65 | } |
| @@ -16,7 +16,7 @@ struct CloneDelegate { · 15 unmodified lines | ||
| 16 | 16 | impl fetch::Delegate for CloneDelegate { |
| 17 | 17 | fn negotiate(&mut self, refs: &[Ref], arguments: &mut Arguments, _previous_result: Option<&Response>) -> Action { |
| 18 | 18 | for r in refs { |
| 19 | − arguments.want(r.unpack_common().1.to_borrowed()); | |
| 19 | + arguments.want(r.unpack().1.to_borrowed()); | |
| 20 | 20 | } |
| 21 | 21 | Action::Close |
| 22 | 22 | } |
| @@ -20,7 +20,7 @@ struct CloneDelegate<W: io::Write> { · 19 unmodified lines | ||
| 20 | 20 | impl<W: io::Write> git_protocol::fetch::Delegate for CloneDelegate<W> { |
| 21 | 21 | fn negotiate(&mut self, refs: &[Ref], arguments: &mut Arguments, _previous: Option<&Response>) -> Action { |
| 22 | 22 | for r in refs { |
| 23 | − arguments.want(r.unpack_common().1.to_borrowed()); | |
| 23 | + arguments.want(r.unpack().1.to_borrowed()); | |
| 24 | 24 | } |
| 25 | 25 | Action::Close |
| 26 | 26 | } |