Avoid expiring git sources when unnecessary #6458
Merged
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.
What was the end-user or developer problem that led to this PR?
I was very confused while writing a regression spec for something else, because Bundler kept expiring the GIT source in the dummy test lockfile I was using and I didn't know why.
Turns out I was writing the lockfile GIT source with a trailing slash, and because of this, Bundler was expiring it because the Gemfile source did not have a trailing slash.
A "style change" like this one should not make Bundler expire a source and the same thing is already handled for GEM sources.
What is your fix for the problem, implemented in this PR?
Properly normalize git sources URIs to not care about trailing slashes.
I initially normalized this to always include a trailing slash in the lockfile, which is what GEM sources do, but that caused a lot of spec failures because currently GIT sources are locked with whatever the Gemfile specifies, and that's usually without a trailing slash.
So for now I'm just making this consistent, but not changing the way most GIT sources are locked.
Make sure the following tasks are checked