Commit Graph

6 Commits

Author SHA1 Message Date
Jeff Valore
25742bb522 fix(resolution): Allow github dependency refs of type "#pull/1/head" (#5673)
**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"`
2018-04-15 22:02:18 +01:00
Ian Sutherland
3e1c3a7ed2 fix(resolution): support semver: in git URLs (#5126) (#5140)
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.
2018-01-02 09:14:07 -05:00
Krzysztof Zbudniewek
4f41887d36 fix(git-spawn): Set GIT_SSH_VARIANT (#4806)
**Summary**

Fixes #4729.
Previous version in #4805.

Manually specify `GIT_SSH_VARIANT` in order to get package download via `git+ssh` with a non-standard port when using `plink.exe` working.

Without `GIT_SSH_VARIANT` set properly, Git won't convert `-p` into `-P` and `plink.exe` will throw an error about unknown `-p` parameter.

**Test plan**

*Before:*
![virtualbox_msedge_-_win10_30_10_2017_16_35_24](https://user-images.githubusercontent.com/5042328/32179804-9a87c676-bd90-11e7-86d0-09380d61eadf.png)

*After:*
![virtualbox_msedge_-_win10_30_10_2017_19_07_15](https://user-images.githubusercontent.com/5042328/32187512-9bcb980e-bda5-11e7-96ea-27a513837d6e.png)

Also got `git-spawn.js` test suite updated for testing `GIT_SSH_VARIANT`.
2017-10-31 09:10:09 +00:00
kaylieEB
4e3ecf8a38 Fix: Include pull requests in git ref search (#4411)
**Summary**

Fixes https://github.com/yarnpkg/yarn/issues/4369, a regression from previous refactor.
Include `pull` requests in ref search and test for it later when it's called by github resolver.

*BEFORE*
![before](https://user-images.githubusercontent.com/18429494/30309691-7aeabe2e-9741-11e7-8e34-c75413b83d99.png)


*AFTER*
![after](https://user-images.githubusercontent.com/18429494/30309693-7dcc3528-9741-11e7-8a74-bc7585fd6177.png)

**Test plan**

Added a unit test in `git/git-ref-resolver.js`
2017-09-12 10:54:57 +01:00
Burak Yiğit Kaya
73921a6eb5 Fix: respect GIT_SSH env variable when calling Git and support plink (#4302)
**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.
2017-09-05 13:29:53 +03:00
Jeremy Judeaux
67dfc7af80 Fix: Refactor branch/tag resolution for git dependencies (#3836)
**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.
2017-07-26 10:45:42 +01:00