Skip to content

Commit

Permalink
install: verify that git+https:// URIs are normalized like they used …
Browse files Browse the repository at this point in the history
…to be

PR-URL: npm/npm#8947
  • Loading branch information
zkat authored and iarna committed Jul 17, 2015
1 parent 20010a9 commit 9525294
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/tap/add-remote-git-get-resolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ test('add-remote-git#get-resolved HTTPS', function (t) {
verify('https://github.com/foo/repo#master')
verify('git+https://github.com/foo/repo.git#master')
verify('git+https://github.com/foo/repo#decadacefadabade')
// DEPRECATED
// this is an invalid URL but we normalize it
// anyway. Users shouldn't use this in the future. See note
// below for how this affected non-hosted URLs.
// See https://github.com/npm/npm/issues/8881
verify('git+https://github.com:foo/repo.git#master')

function verify (uri) {
t.equal(
Expand All @@ -90,6 +96,12 @@ test('add-remote-git#get-resolved edge cases', function (t) {
'don\'t break non-hosted scp-style locations'
)

// DEPRECATED
// When we were normalizing all git URIs, git+https: was being
// automatically converted to ssh:. Some users were relying
// on this funky behavior, so after removing the aggressive
// normalization from non-hosted URIs, we brought this back.
// See https://github.com/npm/npm/issues/8881
t.equal(
tryGetResolved('git+https://bananaboat:galbi/blah', 'decadacefadabade'),
'git+https://bananaboat/galbi/blah#decadacefadabade',
Expand Down

0 comments on commit 9525294

Please sign in to comment.