From 2baa5f1d6d97b2cf943a701b4586782f1ba70ce8 Mon Sep 17 00:00:00 2001 From: Ivan Motsch Date: Thu, 25 Feb 2016 15:39:41 +0100 Subject: [PATCH] Tests on Windows with URIish fail The reason is that URIish(URL) and URIish(String) make different parsing of path / rawPath with regard to drive letters. /C:/... for URL and C:/... for String. This patch fixes the issue. Change-Id: I8e2013fff30b7bb198ff733c038e21366667b8a0 Signed-off-by: Ivan Motsch --- org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java | 2 ++ 1 file changed, 2 insertions(+) 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 3ee2feb14..3c5c8dadd 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java @@ -376,8 +376,10 @@ public class URIish implements Serializable { public URIish(final URL u) { scheme = u.getProtocol(); path = u.getPath(); + path = cleanLeadingSlashes(path, scheme); try { rawPath = u.toURI().getRawPath(); + rawPath = cleanLeadingSlashes(rawPath, scheme); } catch (URISyntaxException e) { throw new RuntimeException(e); // Impossible }