summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEdyta Przymus2012-08-28 07:32:47 (EDT)
committer Szymon Brandys2012-08-28 09:18:41 (EDT)
commit30a3135945c3545d24c5eb96b30dfc635a7f5729 (patch)
tree9aa6f87048759aec139b212bd4afe5a469a215a6
parente9391562431f79491a969851c19c001938773304 (diff)
downloadorg.eclipse.orion.client-30a3135945c3545d24c5eb96b30dfc635a7f5729.zip
org.eclipse.orion.client-30a3135945c3545d24c5eb96b30dfc635a7f5729.tar.gz
org.eclipse.orion.client-30a3135945c3545d24c5eb96b30dfc635a7f5729.tar.bz2
Bug 388189 - [Review request] use dojo Url object instead of parsing url by hand in checkSsh function
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js4
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitReviewRequestExplorer.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
index 62b6882..f23c666 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
@@ -1700,8 +1700,8 @@ var exports = {};
callback: function(data) {
var sshCheck = function(gitUrl){
var url = gitUrl;
- var isSsh = gitUrl.split(":")[0];
- if(isSsh === "ssh"){
+ var scheme = new dojo._Url(url).scheme;
+ if(scheme === "ssh"){
var indexOfAt = url.indexOf("@");
if(indexOfAt !== -1){
var urlNoUser = "ssh://" + url.substr(indexOfAt + 1);
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitReviewRequestExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitReviewRequestExplorer.js
index 92e9fa1..62216e5 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitReviewRequestExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitReviewRequestExplorer.js
@@ -294,8 +294,8 @@ define(['i18n!git/nls/gitmessages', 'require', 'dojo','dijit', 'orion/section',
GitReviewRequestExplorer.prototype.sshCheck = function(remote){
var url = remote;
- var isSsh = remote.split(":")[0];
- if(isSsh === "ssh"){
+ var scheme = new dojo._Url(url).scheme;
+ if(scheme === "ssh"){
var indexOfAt = url.indexOf("@");
if(indexOfAt !== -1){
var urlNoUser = "ssh://" + url.substr(indexOfAt + 1);