Fix for issue #2840#4989
Merged
Merged
Conversation
|
This change will increase the build size from 10.26 MB to 10.26 MB, an increase of 796 bytes (0%)
|
|
This change will decrease the build size from 10.26 MB to 10.25 MB, a decrease of 4.04 KB (0%)
|
Member
|
@davidreis97 Thanks for the PR! can you add a test case for this? |
Contributor
Author
|
Hi @kaylieEB , I just added a test case in the last commit. |
| const name = util.removeSuffix(pathname.split('/')[2], '.git'); | ||
| excludeNames.push(name); | ||
| } | ||
| } else if (getExoticResolver(pattern)) { |
Member
There was a problem hiding this comment.
Can you instead try using guessName util, so something like
if (getExoticResolver(pattern)) {
excludeNames.push(guessName(pattern))
}
This way we avoid git-specific logic in the install command file and other exotic resolvers and hosted git resolvers can't take advantage of this fix too :)
| // When installing a package with the same name as an existing one but from a different repo, | ||
| // the old one should be replaced with the new one in the lock file. | ||
| const firstSource = 'https://github.com/davidreis97/example-yarn-package.git'; | ||
| const secondSource = 'https://github.com/yarnpkg/example-yarn-package.git'; |
Member
There was a problem hiding this comment.
To avoid making requests in the ci, can you add the tarball cache to __tests__/fixtures/request-cache/GET/github.com
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.
Summary
This is a fix for issue #2840 .
It fixes the issue by comparing the name of the git repo with the entries on the lockfile, instead of comparing the whole git url (which wouldn't match with the version already on the lockfile, since the url would be different).
Test plan
We tested with multiple git repositories, including the ones that were given as an example on the issue page.