Commit Graph

37 Commits

Author SHA1 Message Date
Adam Stankiewicz
bb17839bc2 Allow shallow cloning when source is a ssh protocol (#2506) 2018-03-28 17:37:34 +02:00
Adam Stankiewicz
2052ba3eed Remove jshint 2016-03-30 22:12:24 +02:00
AnthonyBobsin
19fc84007d Implements jscs to enforce a newly created style guide for the repo. Uses jscs to fix some minor style guide warnings. 2015-11-29 16:22:58 -05:00
Vlad Filippov
3d4f9cd919 Fix shallow clone host 2015-11-24 14:21:27 -05:00
Adam Stankiewicz
d614b057c9 fix: Set environment variable as string, not number 2015-10-13 17:27:27 +02:00
Adam Stankiewicz
26f80d25be Put smart host detection behind a configuration, fixes #1764 2015-08-25 22:26:26 +02:00
Nils Winkler
7e0a2ea4cb Added check for empty remote or no protocol set. 2015-03-24 20:36:15 +01:00
Nils Winkler
912808b672 Added support for caching hosts that support shallow cloning. 2015-03-24 20:22:15 +01: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
05ba2ee2f2 Merge pull request #1062 from patrickkettner/dumb-http-fallback
add fallback support to dumb http servers
2014-02-04 01:25:58 -08:00
Patrick Kettner
08af876e01 add fallback support to dumb http servers 2014-02-03 22:32:07 -05:00
Andrew Hutchings
fde7965bc9 Cache output of GitFsResolver.refs and GitRemoteResolver.refs, fixes #1083 2014-02-01 21:43:50 -05:00
André Cruz
6d85ae8e8e Upgrade mout. 2013-09-09 00:52:36 +01: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
23044b3758 Fix throttling issue that causes progress to fire after end. 2013-08-26 14:09:17 +01:00
Tim Schaub
0eac8bb96e Try without shallow clone if fatal error
$ git --version
    git version 1.7.12.4

    $ git clone https://code.google.com/p/closure-library -b master --progress . --depth 1
    Cloning into '.'...
    fatal: expected shallow/unshallow, got Error: internal server error
2013-08-20 12:43:01 -04:00
André Cruz
46937bbb87 Remove check. 2013-08-12 08:44:29 +01:00
André Cruz
9141b3020f Add additional message for proxy users about https//.insteadOf git://, fixes #250. 2013-08-10 23:46:26 +01:00
André Cruz
367c3c3e95 Fix host not correctly being set. 2013-08-10 23:36:48 +01:00
André Cruz
41a3903ac9 Fix typo. 2013-08-10 23:31:39 +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
André Cruz
2386d46609 Decrease the progress delay to 8sec. 2013-07-14 11:47:11 +01:00
André Cruz
dba635aac5 Throttle progress when cloning. 2013-07-14 11:31:51 +01:00
André Cruz
915c8d7afa Detect old versions of git that do not support --b tag when cloning. 2013-07-06 11:59:00 +01:00
André Cruz
9f0ac51e06 Use a more tolerant regexp when splitting lines. 2013-07-05 08:18:38 +01:00
André Cruz
d8cef76592 Added prune command, closes #463. 2013-07-05 01:20:28 +01:00
André Cruz
ca76d41f9a Report progress for remote git resolvers that take too long to clone. 2013-07-04 23:58:35 +01:00
André Cruz
2f16e17ed5 Use LRU cache for the git resolvers runtime cache. 2013-06-23 12:17:53 +01:00
André Cruz
e704733743 Read, use and update persistent resolutions.
Add --save-resolutions to deal with this.
Also:
  - Adjust logging when using compact
  - Minor code adjustments.
2013-06-07 13:05:07 +01:00
André Cruz
afd01cc40c Change from promise progress events to hierarchical logger.
This is an huge commit, contains other small tweaks/fixes.
2013-06-03 16:31:19 +01:00
André Cruz
454436905c Huge commit.
- Changed way renderers work
- Move worker to a separate module
- Improve loglevel
- Minor tweaks
- Fix tests
2013-05-27 22:59:13 +01:00
André Cruz
01d8d0dbec Minor CS fixes. 2013-05-24 23:03:19 +01:00
André Cruz
9fa91aab36 More tweaks related to notifications, add notifications to remaining resolvers. 2013-05-24 00:03:44 +01:00
André Cruz
382c857a4b Tweaks to notifications. 2013-05-23 23:43:11 +01:00
André Cruz
e09a3b8cbf Huge commit, implement rough working version of the whole resolve process. 2013-05-13 11:09:04 +01:00