Skip to content

Commit 6fdc432

Browse files
committed
Merge branch 'fix/162-handle-ssh-with-url-encoded-spaces' of github.com:RGENT/git-url-parse into new-version
2 parents ae10001 + de12c56 commit 6fdc432

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test": "test"
3030
},
3131
"dependencies": {
32-
"git-up": "^7.0.0"
32+
"git-up": "^8.0.0"
3333
},
3434
"devDependencies": {
3535
"tester": "^1.3.1"

test/index.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ tester.describe("parse urls", test => {
330330
test.expect(res.source).toBe("dev.azure.com");
331331
test.expect(res.owner).toBe("ProjectName");
332332
test.expect(res.name).toBe("RepoName");
333+
334+
// Parse URL for URL-encoded spaces
335+
var res = gitUrlParse("[email protected]:v3/CompanyName/Project%20Name/Repo%20Name");
336+
test.expect(res.source).toBe("dev.azure.com");
337+
test.expect(res.owner).toBe("Project Name");
338+
test.expect(res.name).toBe("Repo Name");
333339
});
334340

335341
// https Visual Studio Team Services (VSTS)
@@ -363,13 +369,12 @@ tester.describe("parse urls", test => {
363369
});
364370

365371
// ssh Visual Studio Team Services (VSTS)
366-
// TODO Check why this does not work anymore.
367-
// test.should("parse Visual Studio Team Services (VSTS) SSH urls", () => {
368-
// var res = gitUrlParse("[email protected]:v3/CompanyName/ProjectName/RepoName");
369-
// test.expect(res.source).toBe("visualstudio.com");
370-
// test.expect(res.owner).toBe("ProjectName");
371-
// test.expect(res.name).toBe("RepoName");
372-
// });
372+
test.should("parse Visual Studio Team Services (VSTS) SSH urls", () => {
373+
var res = gitUrlParse("[email protected]:v3/CompanyName/ProjectName/RepoName");
374+
test.expect(res.source).toBe("visualstudio.com");
375+
test.expect(res.owner).toBe("ProjectName");
376+
test.expect(res.name).toBe("RepoName");
377+
});
373378

374379
// custom git hosted URL with 2 parts SLD
375380
test.should("parse Gih hosted urls with two parts SLD", () => {

0 commit comments

Comments
 (0)