Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Support shallow clone for ssh protocol #1964

Closed

Conversation

akkaradej
Copy link

I found that GitRemoteResolver is not supports shallow cloning if the source is a ssh protocol.

This is caused by

// Constructor
this._remote = url.parse(this._source);

If the source is git@bitbucket.org:foo/bar.git, it cannot find the protocol
that lead to make the condition inside _supportsShallowCloning() is always false

// _supportsShallowCloning
if (this._remote == null || this._remote.protocol == null) {
  return Q.resolve(false);
}

@sheerun
Copy link
Contributor

sheerun commented Oct 24, 2015

What bower version are you using? Can you provide sample repository? I've tried git@bitbucket.org:mirror/rails.git but I get fast clone on latest Bower without this change.

@akkaradej
Copy link
Author

I using bower 1.6.3 and this's my .bowerrc

{
  "shallow-clone-hosts": "bitbucket.org"
}

Try $ bower install git@bitbucket.org:mirror/rails.git#1-2-stable

As a bower progress:
Without this change, it downloads 351293 objects

bower progress      rails#1-2-stable Receiving objects:   2% (7026/351293), 988.00 KiB | 851.00 KiB/s

Compare wtith this change, it downloads 1293 objects

bower progress      rails#1-2-stable Receiving objects:  27% (351/1293), 540.00 KiB | 188.00 KiB/s

@sheerun
Copy link
Contributor

sheerun commented Mar 28, 2018

Merged as #2506

@sheerun sheerun closed this Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants