**Summary**
Fixes#1610. Previously yarn would allow a dependency on a GitHub pull request with "#1/head" where 1 is the PR number. npm allows the format "#pull/1/head" as well. For compatibility, allowing Yarn to fall back to this format.
**Test plan**
Added a test to `git-ref-resolver` to test the case `"pull/10/head"`
fixes#5126
**Summary**
* Add support for github URLs that include `semver:^x.x.x` in the tag/branch name. This is supported by NPM so improves compatibility.
**Summary**
Fixes#4167. We use `$GIT_SSH_COMMAND` which overrides `$GIT_SSH`
and causes issues on some systems, where a different `ssh`
executable like `plink` is used. This patch makes our batch-mode
enforcement smarter and more respectful and adds support for `plink`.
**Test Plan**
Unit tests.
**Summary**
For git dependencies, the branch/tag resolution does not always work as expected.
Refactor the code to make the resolution algorithm more explicit and follow discussions in #3720.
**Test plan**
New test in `__tests__/util/git-ref-resolver.js`.
Also, benefit from the fact that Travis CI ran the test with an older Git version. I don't know if we have a minimum git version requirement, it seems we currently don't test against any specific version.
**Implementation details**
I refactored `parseRefs` to return the full ref name, so we can differentiate branches and tags.
I use `git ls-remote --symref` to get the default branch name. This works only in recent versions of git (thanks Travis CI for reporting the issue), so I fall back to another algorithm if `--symref` is unavailable.
I tried not to use the variable name `hash`, which is confusing between the git-url hash and the commit hash.