Skip to content

Commit

Permalink
git: git: -> https: -> ssh:
Browse files Browse the repository at this point in the history
Swapped SSH and HTTPS URLs to make the error messaging make more sense,
and also make it less common for users to be stuck with password prompts
they can't do anything about.
  • Loading branch information
othiym23 committed Apr 16, 2015
1 parent 387f889 commit 394c2f5
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
26 changes: 13 additions & 13 deletions lib/cache/add-remote-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@ function tryGitProto (from, hostedInfo, cb) {

log.silly('tryGitProto', 'attempting to clone', gitURL)
tryClone(from, gitURL, true, function (er) {
if (er) return trySSH(from, hostedInfo, cb)

cb.apply(this, arguments)
})
}

function trySSH (from, hostedInfo, cb) {
var sshURL = hostedInfo.ssh()
if (!sshURL) return tryHTTPS(from, hostedInfo, cb)

log.silly('trySSH', 'attempting to clone', sshURL)
tryClone(from, sshURL, true, function (er) {
if (er) return tryHTTPS(from, hostedInfo, cb)

cb.apply(this, arguments)
Expand All @@ -103,7 +91,19 @@ function tryHTTPS (from, hostedInfo, cb) {
}

log.silly('tryHTTPS', 'attempting to clone', httpsURL)
tryClone(from, httpsURL, false, cb)
tryClone(from, httpsURL, true, function (er) {
if (er) return trySSH(from, hostedInfo, cb)

cb.apply(this, arguments)
})
}

function trySSH (from, hostedInfo, cb) {
var sshURL = hostedInfo.ssh()
if (!sshURL) return tryHTTPS(from, hostedInfo, cb)

log.silly('trySSH', 'attempting to clone', sshURL)
tryClone(from, sshURL, false, cb)
}

function tryClone (from, combinedURL, silent, cb) {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/gist-short-shortcut-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ test('setup', function (t) {
test('gist-short-shortcut-package', function (t) {
var cloneUrls = [
['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH second'],
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third']
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/gist-short-shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ test('setup', function (t) {
test('gist-shortcut', function (t) {
var cloneUrls = [
['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH second'],
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third']
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/gist-shortcut-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ test('setup', function (t) {
test('gist-shortcut-package', function (t) {
var cloneUrls = [
['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH second'],
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third']
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/gist-shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ test('setup', function (t) {
test('gist-shortcut', function (t) {
var cloneUrls = [
['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH second'],
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs third']
['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/github-shortcut-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ test('setup', function (t) {
test('github-shortcut-package', function (t) {
var cloneUrls = [
['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'],
['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second'],
['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third']
['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'],
['git@github.com:foo/private.git', 'GitHub shortcuts try SSH third']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down
4 changes: 2 additions & 2 deletions test/tap/github-shortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ test('setup', function (t) {
test('github-shortcut', function (t) {
var cloneUrls = [
['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'],
['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second'],
['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third']
['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third'],
['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
Expand Down

0 comments on commit 394c2f5

Please sign in to comment.