Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip setting hash if hash was not set previously #1871

Merged
merged 7 commits into from
Nov 16, 2016
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions end_to_end_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ This directory contains end-to-end tests for Yarn. The tests perform the followi
1. Spin up a fresh Docker container
2. Install Yarn through the package repository
3. Run `yarn add react` in a test directory
4. Run `yarn add 'substack/node-mkdirp#master'` in a test directory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this now that it is covered with unit test.

1 change: 1 addition & 0 deletions end_to_end_tests/data/run-yarn-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ mkdir yarntest
cd yarntest
echo {} > package.json
yarn add react || fail_with_log
yarn add 'substack/node-mkdirp#master' || fail_with_log
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

6 changes: 5 additions & 1 deletion src/package-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export default class PackageFetcher {
newPkg = res.package;

// update with new remote
ref.remote.hash = res.hash;
// but only if there was a hash previously as the tarball fetcher does not provide a hash.
if(ref.remote.hash) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit to add a space here, if( -> if (.

ref.remote.hash = res.hash;
}

if (res.resolved) {
ref.remote.resolved = res.resolved;
}
Expand Down