Commit Graph

22 Commits

Author SHA1 Message Date
Adam Stankiewicz
6bc778df32 Format with prettier (#2510) 2018-03-28 19:28:43 +02:00
Adam Stankiewicz
bb17839bc2 Allow shallow cloning when source is a ssh protocol (#2506) 2018-03-28 17:37:34 +02:00
Adam Stankiewicz
53eeca97d3 Use eslint instead jscs 2016-03-31 00:27:17 +02:00
Adam Stankiewicz
df8e5a16be Fix readdir call on Windows
Sometimes it return ENOENT instead of ENODIR for normal files.

This broke code paths in few places. Also, see:
https://github.com/isaacs/chmodr/pull/8
2015-10-14 16:09:38 +02: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
Adam Stankiewicz
06a8f2afab Read .bowerrc from specified cwd, fixes #1301 2014-09-06 02:38:40 +02:00
André Cruz
f5999e84a2 Add missing test. 2013-08-10 15:45:24 +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
15957bc9ac Close GH-716: Add initial packages script that allows creating of packages usable for tests. 2013-08-04 20:41:42 +01:00
André Cruz
0cf8af00b3 Separate logger into its own module. 2013-07-20 20:37:05 +01:00
André Cruz
3f7bf15cdb Add progress tests to be done later. 2013-07-14 12:00:07 +01:00
André Cruz
fb4b1827db Minor tests tweak. 2013-07-13 21:42:24 +01:00
André Cruz
f2775c18a1 Fix tests due tag change. 2013-07-12 16:22:53 +01:00
André Cruz
fe1a635c14 Switch to graceful-fs. 2013-07-01 20:31:28 +01:00
André Cruz
2f16e17ed5 Use LRU cache for the git resolvers runtime cache. 2013-06-23 12:17:53 +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
e09a3b8cbf Huge commit, implement rough working version of the whole resolve process. 2013-05-13 11:09:04 +01:00