-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(git): match git dependencies by name instead of whole url
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.
- Loading branch information
1 parent
b827eae
commit 2065988
Showing
11 changed files
with
177 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "install-forked-git", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT" | ||
} |
Binary file added
BIN
+22.9 KB
....com/davidreis97/example-yarn-package/tar.gz/0b8f43f77361ff7739bcb42de7787b09208bcece.bin
Binary file not shown.
Binary file added
BIN
+22.9 KB
...thub.com/yarnpkg/example-yarn-package/tar.gz/0b8f43f77361ff7739bcb42de7787b09208bcece.bin
Binary file not shown.
Binary file added
BIN
+814 Bytes
.../fixtures/request-cache/GET/github.com/davidreis97/example-yarn-package.git/info/refs.bin
Binary file not shown.
Binary file added
BIN
+1007 Bytes
...ts__/fixtures/request-cache/GET/github.com/yarnpkg/example-yarn-package.git/info/refs.bin
Binary file not shown.
50 changes: 50 additions & 0 deletions
50
...avidreis97/example-yarn-package/0b8f43f77361ff7739bcb42de7787b09208bcece/package.json.bin
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
HTTP/1.1 200 OK | ||
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox | ||
Strict-Transport-Security: max-age=31536000 | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: deny | ||
X-XSS-Protection: 1; mode=block | ||
ETag: "36952fd724b4f5fc4240d20b883deda155134db3" | ||
Content-Type: text/plain; charset=utf-8 | ||
Cache-Control: max-age=300 | ||
X-Geo-Block-List: | ||
X-GitHub-Request-Id: F20A:258A9:CAEC81:D518BE:5A205A53 | ||
Content-Length: 485 | ||
Accept-Ranges: bytes | ||
Date: Thu, 30 Nov 2017 19:21:56 GMT | ||
Via: 1.1 varnish | ||
Connection: keep-alive | ||
X-Served-By: cache-mad9433-MAD | ||
X-Cache: MISS | ||
X-Cache-Hits: 0 | ||
X-Timer: S1512069716.351893,VS0,VE140 | ||
Vary: Authorization,Accept-Encoding | ||
Access-Control-Allow-Origin: * | ||
X-Fastly-Request-ID: 182c3a5089ec0a3c1eeb6f16e623487b0393aa8d | ||
Expires: Thu, 30 Nov 2017 19:26:56 GMT | ||
Source-Age: 0 | ||
|
||
{ | ||
"name": "example-yarn-package", | ||
"version": "1.0.0", | ||
"description": "An example package to demonstrate Yarn", | ||
"main": "index.js", | ||
"repository": { | ||
"url": "github.com/yarnpkg/example-yarn-package", | ||
"type": "git" | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"author": "Yarn Contributors", | ||
"license": "BSD-2-Clause", | ||
"dependencies": { | ||
"lodash": "^4.16.2" | ||
}, | ||
"devDependencies": { | ||
"jest-cli": "15.1.1" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...om/yarnpkg/example-yarn-package/0b8f43f77361ff7739bcb42de7787b09208bcece/package.json.bin
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
HTTP/1.1 200 OK | ||
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox | ||
Strict-Transport-Security: max-age=31536000 | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: deny | ||
X-XSS-Protection: 1; mode=block | ||
ETag: "36952fd724b4f5fc4240d20b883deda155134db3" | ||
Content-Type: text/plain; charset=utf-8 | ||
Cache-Control: max-age=300 | ||
X-Geo-Block-List: | ||
X-GitHub-Request-Id: 73C6:3A6F:4C9B26:521B93:5A205A9B | ||
Content-Length: 485 | ||
Accept-Ranges: bytes | ||
Date: Thu, 30 Nov 2017 19:23:08 GMT | ||
Via: 1.1 varnish | ||
Connection: keep-alive | ||
X-Served-By: cache-mad9433-MAD | ||
X-Cache: MISS | ||
X-Cache-Hits: 0 | ||
X-Timer: S1512069788.063184,VS0,VE123 | ||
Vary: Authorization,Accept-Encoding | ||
Access-Control-Allow-Origin: * | ||
X-Fastly-Request-ID: 082c2b71081ca345fdae028f317f58914a3f27fe | ||
Expires: Thu, 30 Nov 2017 19:28:08 GMT | ||
Source-Age: 0 | ||
|
||
{ | ||
"name": "example-yarn-package", | ||
"version": "1.0.0", | ||
"description": "An example package to demonstrate Yarn", | ||
"main": "index.js", | ||
"repository": { | ||
"url": "github.com/yarnpkg/example-yarn-package", | ||
"type": "git" | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"author": "Yarn Contributors", | ||
"license": "BSD-2-Clause", | ||
"dependencies": { | ||
"lodash": "^4.16.2" | ||
}, | ||
"devDependencies": { | ||
"jest-cli": "15.1.1" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
__tests__/fixtures/request-cache/HEAD/github.com/davidreis97/example-yarn-package.bin
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
HTTP/1.1 200 OK | ||
Server: GitHub.com | ||
Date: Thu, 30 Nov 2017 18:04:38 GMT | ||
Content-Type: text/html; charset=utf-8 | ||
Status: 200 OK | ||
Cache-Control: no-cache | ||
Vary: X-PJAX | ||
X-UA-Compatible: IE=Edge,chrome=1 | ||
Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Mon, 30 Nov 2037 18:04:38 -0000; secure; HttpOnly | ||
Set-Cookie: _gh_sess=eyJzZXNzaW9uX2lkIjoiNWUzN2ZjMzQ1NzAxZTdiMTYwMjUyNjEwNDFlOWU2MDkiLCJsYXN0X3JlYWRfZnJvbV9yZXBsaWNhcyI6MTUxMjA2NTA3ODYzNSwic3B5X3JlcG8iOiJkYXZpZHJlaXM5Ny9leGFtcGxlLXlhcm4tcGFja2FnZSIsInNweV9yZXBvX2F0IjoxNTEyMDY1MDc4LCJfY3NyZl90b2tlbiI6Ilc2ZS9VY2dpNkZ1M2xDcnRDa2JLY2tOdS9KUmh5djZOaU5pTHN1SEZVZW89IiwiZmxhc2giOnsiZGlzY2FyZCI6WyJhbmFseXRpY3NfbG9jYXRpb24iXSwiZmxhc2hlcyI6eyJhbmFseXRpY3NfbG9jYXRpb24iOiIvPHVzZXItbmFtZT4vPHJlcG8tbmFtZT4ifX19--42e9c0d2914379c385b7ba452dcdb16dd9b2806e; path=/; secure; HttpOnly | ||
X-Request-Id: 19e3889a0c30643447b97012ce7ca286 | ||
X-Runtime: 0.211652 | ||
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors" | ||
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; img-src 'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; media-src 'none'; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com | ||
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload | ||
Public-Key-Pins: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: deny | ||
X-XSS-Protection: 1; mode=block | ||
X-Runtime-rack: 0.220571 | ||
X-GitHub-Request-Id: F043:3B8C:1C5A8A7:330DFDC:5A204835 | ||
|
22 changes: 22 additions & 0 deletions
22
__tests__/fixtures/request-cache/HEAD/github.com/yarnpkg/example-yarn-package.bin
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
HTTP/1.1 200 OK | ||
Server: GitHub.com | ||
Date: Thu, 30 Nov 2017 18:17:52 GMT | ||
Content-Type: text/html; charset=utf-8 | ||
Status: 200 OK | ||
Cache-Control: no-cache | ||
Vary: X-PJAX | ||
X-UA-Compatible: IE=Edge,chrome=1 | ||
Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Mon, 30 Nov 2037 18:17:52 -0000; secure; HttpOnly | ||
Set-Cookie: _gh_sess=eyJzZXNzaW9uX2lkIjoiYzJjNDMxOWI3NmVhYjQxNDY0NzczMGIxNjVhYzY4NmMiLCJsYXN0X3JlYWRfZnJvbV9yZXBsaWNhcyI6MTUxMjA2NTg3MjgzNSwic3B5X3JlcG8iOiJ5YXJucGtnL2V4YW1wbGUteWFybi1wYWNrYWdlIiwic3B5X3JlcG9fYXQiOjE1MTIwNjU4NzIsIl9jc3JmX3Rva2VuIjoiKzVKWFFMbVNwTDZubEZnTFRIV3RqakpTOFVoZTlKeXV0YWhWd3p1U09ZVT0iLCJmbGFzaCI6eyJkaXNjYXJkIjpbImFuYWx5dGljc19sb2NhdGlvbiJdLCJmbGFzaGVzIjp7ImFuYWx5dGljc19sb2NhdGlvbiI6Ii88dXNlci1uYW1lPi88cmVwby1uYW1lPiJ9fX0%3D--eb2c6172e33b3c510669a66c4216a0377ad5d95c; path=/; secure; HttpOnly | ||
X-Request-Id: b40e6b8f6e8cf58a9088881b5f288969 | ||
X-Runtime: 0.210270 | ||
Expect-CT: max-age=2592000, report-uri="https://api.github.com/_private/browser/errors" | ||
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com collector.githubapp.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; img-src 'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com; media-src 'none'; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com | ||
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload | ||
Public-Key-Pins: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: deny | ||
X-XSS-Protection: 1; mode=block | ||
X-Runtime-rack: 0.218641 | ||
X-GitHub-Request-Id: F724:3BA3:1FF90CB:3E5AD51:5A204B50 | ||
|
This file contains 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