Previously, the expanded prefix would be a list of possibilities, even though it's such a common case that we really want to avoid spamming the remote about it when asking for HEAD during clone for instance.
Showing the changes to git-refspec/src (1 of 2 files). Show all
Unified · Split
| @@ -134,6 +134,9 @@ impl<'a> RefSpecRef<'a> { · 133 unmodified lines | |||
| 134 | Operation::Fetch => self.source(), | 134 | Operation::Fetch => self.source(), |
| 135 | Operation::Push => self.destination(), | 135 | Operation::Push => self.destination(), |
| 136 | }?; | 136 | }?; |
| 137 | if source == "HEAD" { | ||
| 138 | return source.into(); | ||
| 139 | } | ||
| 137 | let suffix = source.strip_prefix(b"refs/")?; | 140 | let suffix = source.strip_prefix(b"refs/")?; |
| 138 | let slash_pos = suffix.find_byte(b'/')?; | 141 | let slash_pos = suffix.find_byte(b'/')?; |
| 139 | let prefix = source[..="refs/".len() + slash_pos].as_bstr(); | 142 | let prefix = source[..="refs/".len() + slash_pos].as_bstr(); |