aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2010-07-15 01:16:09 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2010-07-15 01:16:09 +0200
commit845714158adc144e0d7db53cef96503a93fb6cff (patch)
tree0b8cdc309e0799559be402a2ea9375d682e4ccfc /org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
parent0ef99921fa9f651ba13325de7a4713bfedca4d00 (diff)
downloadjgit-845714158adc144e0d7db53cef96503a93fb6cff.tar.gz
jgit-845714158adc144e0d7db53cef96503a93fb6cff.zip
Handle the tilde notation (~user) of git url
When the path is prefixed with ~ the URI parser thought about this as /~. Strip the / if the next character is the tilde. Bug: 307017 Change-Id: I58203e5617956b46d83e8987d1f8042beddffac3 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
index 15bd0b1dee..3f533281b4 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
@@ -104,6 +104,9 @@ public class URIish implements Serializable {
&& (path.charAt(1) >= 'A' && path.charAt(1) <= 'Z'
|| path.charAt(1) >= 'a' && path.charAt(1) <= 'z'))
path = path.substring(1);
+ else if (scheme != null && path.length() >= 2
+ && path.charAt(0) == '/' && path.charAt(1) == '~')
+ path = path.substring(1);
} else {
matcher = SCP_URI.matcher(s);
if (matcher.matches()) {