Skip to content

Commit

Permalink
Merge branch 'fix-user@host'
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Jul 15, 2015
2 parents f1f6714 + 11a69a9 commit 2fea7be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var RE_GIT_URL = /^git:\/\/([^\/]+)\/([^\/]+)\/(.+?)(?:\.git)?$/i;
// ssh://hostname/username/reponame.git
var RE_SSH_URL = /^ssh:\/\/([^\/]+)\/([^\/]+)\/(.+?)(?:\.git)?$/i;
// https://hostname/username/reponame.git
var RE_HTTP_URL = /^https?:\/\/([^\/]+)\/([^\/]+)\/(.+?)(?:\.git)?$/i;
var RE_HTTP_URL = /^https?:\/\/(?:[a-z0-9-_]+@)?([^\/]+)\/([^\/]+)\/(.+?)(?:\.git)?$/i;

function parse(uri) {
var match = RE_SCP_URL.exec(uri) ||
Expand Down
3 changes: 3 additions & 0 deletions test/gitopen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('gitresolve.parse()', function () {
['git://github.com/hotoo/gitopen.git', {hostname: 'github.com', username:'hotoo', reponame:'gitopen'}],
['ssh://github.com/hotoo/gitopen.git', {hostname: 'github.com', username:'hotoo', reponame:'gitopen'}],
['https://github.com/hotoo/gitopen.git', {hostname: 'github.com', username:'hotoo', reponame:'gitopen'}],
['https://[email protected]/hotoo/gitopen.git', {hostname: 'bitbucket.org', username:'hotoo', reponame:'gitopen'}],
];
cases.forEach(function(test){
it('gitresolve.parse(' + test[0] + ')', function () {
Expand All @@ -22,6 +23,7 @@ describe('gitresolve.resolve()', function () {
['git://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['ssh://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['https://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['https://[email protected]/hotoo/gitopen.git', 'bitbucket.org/hotoo/gitopen'],
];
cases.forEach(function(test){
it('gitresolve.resolve(' + test[0] + ',{base})', function () {
Expand All @@ -45,6 +47,7 @@ describe('gitresolve()', function () {
['git://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['ssh://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['https://github.com/hotoo/gitopen.git', 'github.com/hotoo/gitopen'],
['https://[email protected]/hotoo/gitopen.git', 'bitbucket.org/hotoo/gitopen'],
];
cases.forEach(function(test){
it('gitresolve(' + test[0] + ')', function () {
Expand Down

0 comments on commit 2fea7be

Please sign in to comment.