[6.0] Move the 'GitRepositoryProvider' to compare urls using their canonical representation, correctly accepting results where repositories only differ by '.git' #7809
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.
Cherry-pick #7741.
Short Explanation: Fixed an issue where repositories would be re-cloned each build rather than using the cache due to git validation errors.
Detailed Explanation: Validating the origin of checked-out repositories no longer ensures that the path extension (often .git) matches the repository's specifier, as different git clients inconsistently preserve the path extension of the remote. Moving to the CanonicalPackageURL also ensures that absolute paths are treated as urls with a file:// scheme, matching git's behavior.
Scope: Dependency resolution - helps re-use existing checkouts for repositories where the remotes only differ by path extension.
Risk: Ignoring inconsistencies in the path extension could lead to an inconsistent in-memory cache state, if subsystems are keeping references to un-canonicalized remotes as strings.
Testing: This change is accompanied by a series of new tests that ensure we preserve this behavior in the future.
Issue: rdar://129329704
Original PR: #7741