diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-07 09:22:56 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-05-07 09:25:02 -0400 |
commit | b016de996e77b3d7b6e68d8442c47a50e2a3d2eb (patch) | |
tree | 25a9a7bb5b45d9856e3601bde19d5e5e3b357b6e /src | |
parent | a341a5e8d5080142583fc03ea34dc1db7eb10364 (diff) | |
download | gitblit-b016de996e77b3d7b6e68d8442c47a50e2a3d2eb.tar.gz gitblit-b016de996e77b3d7b6e68d8442c47a50e2a3d2eb.zip |
Fix transport determination for SSH urls on port 22
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/gitblit/Constants.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/Constants.java b/src/main/java/com/gitblit/Constants.java index af533996..e4d92e1a 100644 --- a/src/main/java/com/gitblit/Constants.java +++ b/src/main/java/com/gitblit/Constants.java @@ -554,7 +554,12 @@ public class Constants { }
public static Transport fromUrl(String url) {
- String scheme = url.substring(0, url.indexOf("://"));
+ int delim = url.indexOf("://");
+ if (delim == -1) {
+ // if no protocol is specified, SSH is assumed by git clients
+ return SSH;
+ }
+ String scheme = url.substring(0, delim);
return fromString(scheme);
}
}
|