fix 2083 supportsArchive can be changed with nothing beeing cloned #2431
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.
Fix bug #2083
The git cloner could start using archive mode and switch back to local clone mode without cloning anything.
As a result, comands are spawned with a bad (non existent) cwd, leading to a ENOENT error.
This error is ms-interpreted a the lack of the git binary (https://github.com/yarnpkg/yarn/blob/master/src/util/child.js#L41)
Test plan
To reproduce the fixed bug, you need to add a dependency based on:
This package.json:
I can't provide a git server with a node project and a "public" private key to clone the project from CI tests.
Github won't work as it doesn't support the git archive command.
This pull request is the rebased version of #2320