Open
Conversation
The previous implementation would find the prefix that would include `refs/` and the next component. This can be too strict for namespaced references, i.e. `refs/namespaces/*`. This change follows the same approach as the C implementation of Git. It takes the prefix as the whole reference up to the `*`. If there is no `*`, if it starts with `refs/`, take the whole reference. Otherwise, there is no prefix.
The `RefPrefixes` type captures the intent of building a set of `ref-prefix` arguments for the ls-refs protocol. Since refspecs are the natural type that these are built from, as seen in `handshake/mod.rs`, a constructor is provided in the form of `RefPrefixes::from_refspecs`. For other, external API users `RefSpecs::new` and `RefSpecs::extend` are provided.
1a1cf0a to
f045646
Compare
e746ced to
fe5de3e
Compare
2c4a72b to
167bdd1
Compare
9b41e5f to
1f13824
Compare
06bc48e to
0e47b1e
Compare
8b02847 to
1bf0519
Compare
cdbe120 to
78a7ab5
Compare
49231d8 to
bc0a777
Compare
e902b63 to
c6739bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Source pull request: GitoxideLabs/gitoxide#2436
See discussion at GitoxideLabs/gitoxide#2429
I didn't quite have the correct environment set up, so I'm not sure if all the tests are passing, but let's see if CI catches anything I messed up :)