Skip to content
Permalink
Browse files

[FIXED JENKINS-13400] Handle file:///path URLs.

  • Loading branch information...
Jesse Glick
Jesse Glick committed Apr 30, 2012
1 parent 64bf842 commit 6c5a04e06891adfc64d34ead0d44f1e8de10b3a1
@@ -39,6 +39,7 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
@@ -255,7 +256,7 @@ static boolean pathEquals(@NonNull String pathURL, @NonNull String pathAsInConfi
if (pathAsInConfig.equals(pathURL + '/')) {
return true;
}
if (pathURL.startsWith("file:/") && new File(pathAsInConfig).toURI().toString().equals(pathURL)) {
if (pathURL.startsWith("file:/") && URI.create(pathURL).equals(new File(pathAsInConfig).toURI())) {
return true;
}
return false;
@@ -36,6 +36,7 @@
assertTrue(HgExe.pathEquals("http://nowhere.net/hg", "http://nowhere.net/hg"));
assertFalse(HgExe.pathEquals("https://nowhere.net/hg/", "http://nowhere.net/hg/"));
assertTrue(HgExe.pathEquals("file:/var/hg/stuff", "/var/hg/stuff"));
assertTrue(HgExe.pathEquals("file:///var/hg/stuff", "/var/hg/stuff"));
assertFalse(HgExe.pathEquals("file:/var/hg/stuff", "/var/hg/other"));
}

0 comments on commit 6c5a04e

Please sign in to comment.
You can’t perform that action at this time.