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 | 134 | Operation::Fetch => self.source(), |
| 135 | 135 | Operation::Push => self.destination(), |
| 136 | 136 | }?; |
| 137 | + if source == "HEAD" { | |
| 138 | + return source.into(); | |
| 139 | + } | |
| 137 | 140 | let suffix = source.strip_prefix(b"refs/")?; |
| 138 | 141 | let slash_pos = suffix.find_byte(b'/')?; |
| 139 | 142 | let prefix = source[..="refs/".len() + slash_pos].as_bstr(); |