Commit Graph

34 Commits

Author SHA1 Message Date
Adam Stankiewicz
47cc2262e1 Download tar archives from https://github when possible (#2263) 2016-11-07 02:33:43 +01:00
Adam Stankiewicz
53eeca97d3 Use eslint instead jscs 2016-03-31 00:27:17 +02:00
Adam Stankiewicz
da961a9c42 Pass proxy configuration to request.js via env variables 2015-09-28 17:34:06 +02:00
Adam Stankiewicz
9cc3dd4c92 Pass certificate for GitHubResolver and UrlResolver, closes #1869 2015-09-27 18:18:11 +02:00
Nils Winkler
a352d51711 Using a function reference instead of calling directly from constructor 2015-03-24 17:14:28 +01:00
Nils Winkler
4ad5ed64d7 Automatically detecting _smart Git hosts_.
Added logic to automatically detect smart Git hosts that allow shallow
cloning. This is done by sending an `ls-remote` request to the server
and then evaluating the returned HTTP header fields. For this, Curl
verbose logging is enabled for the `ls-remote` request, since Curl
verbose logging sends the returned HTTP headers to `stderr`.

If the `stderr` output contains the desired header

  Content-Type: application/x-git-upload-pack-advertisement

then the server supports shallow cloning.

This approach uses Git and Curl for the heavy lifting. Instead of
implementing the request to the server using a simple HTTP client, Git
is used, since it takes care of authentication using stored credentials.

The used approach should also work for BitBucket, which only sends the
Content-Type header when a specific user agent is used. Using Git to
make the request enables this behavior.

The function to detect the smart Git host
(`GitRemoteResolver.prototype._supportsShallowCloning`) returns a
promise that is resolved when the server's request is evaluated. The
promise handling required an addition to `GitHubResolver.js` - to always
resolve the promise to `true`, since GitHub supports shallow cloning.

Added test cases to verify the new functionality.
2015-03-24 17:13:18 +01:00
Lucas, Justin
09ecb80625 Disable shallow clones for all repos except github.com 2014-07-08 11:39:14 -07:00
André Cruz
1f7bd9fd47 Update to latest version of request-progress, to report downloaded size even without content-length. 2013-08-28 22:38:16 +01:00
André Cruz
4402b80ec9 Close GH-794: Fallback to standard git clone if download/untar fails . 2013-08-17 22:37:03 +01:00
André Cruz
337c0f2d0a Refactor GitHub url matching to a static function on the GitHubResolver. 2013-08-11 20:53:28 +01:00
André Cruz
ee2640bc43 Close GH-747: Do not use --depth=1 if the server does not support it, fixes #744. 2013-08-10 15:43:54 +01:00
Keith Gibbs
9cee8b7b78 Close GH-732: Use https:// protocol instead of git:// when a proxy is set. 2013-08-08 00:36:32 +01:00
Keith Gibbs
a34c8dc502 Close GH-724: Fix for GitHubResolver to use https instead of http for tarball archives. 2013-08-07 14:02:50 +01:00
André Cruz
a97375552f Fix detection of org/repo on ssh URLs.
This was affecting the home command.
2013-08-07 00:08:04 +01:00
Mat Scales
1cec48c065 Fixed JSHint errors so that it can be turned on in Travis 2013-08-05 22:03:12 +02:00
André Cruz
24cabf19af Close GH-705: Refactor download to util and added retry logic in it.. Fixes #704, Fixes #699, Fixes #700 2013-08-02 23:09:31 +01:00
André Cruz
e6b1595cde Signal HTTP protocol errors with EHTTP. 2013-07-22 14:00:55 +01:00
André Cruz
3b376a3d3d Move homepage guess logic to the appropriate resolver. 2013-07-22 13:57:39 +01:00
André Cruz
1e724af838 Get response status errors when using request. 2013-07-22 08:39:03 +01:00
André Cruz
b0dbbc51df Use debug instead of info. 2013-07-20 23:13:05 +01:00
André Cruz
1fe6cde934 Fix progress options. 2013-07-20 22:07:54 +01:00
André Cruz
3fdf639bb4 Typo. 2013-07-20 21:30:44 +01:00
André Cruz
4061ef65e4 Add retry information as debug messages. 2013-07-20 20:45:25 +01:00
André Cruz
62c616f197 Use http agent and introduce replay of http errors on network failure. 2013-07-20 19:52:38 +01:00
André Cruz
bd7579fa65 Use timeout from the config. 2013-07-16 19:53:50 +01:00
André Cruz
b9514692fe GitHub resolver should move contents when extracting. 2013-07-14 15:37:00 +01:00
André Cruz
ed9f883301 Keep structure of the downloaded archive. 2013-07-14 11:59:51 +01:00
André Cruz
2386d46609 Decrease the progress delay to 8sec. 2013-07-14 11:47:11 +01:00
André Cruz
0da1dbdc14 Implement progress when downloading from URLs. 2013-07-14 11:32:14 +01:00
André Cruz
47a1cce5fa Fix GitHub resolver not trimming .git in the repo name. 2013-07-09 20:42:52 +01:00
André Cruz
597100d108 Remove unnecessary stuff. 2013-07-09 13:13:43 +01:00
André Cruz
34a2f1ad65 Add insightful message after registering. 2013-07-07 17:43:16 +01:00
André Cruz
bfe8323753 Add small note. 2013-07-07 11:33:43 +01:00
André Cruz
f2b86ad3ed Add specialised GitHub resolver, closes #597. 2013-07-07 10:22:58 +01:00