From 05bb92980b27cf8379e6a39f993ae21952ffe05d Mon Sep 17 00:00:00 2001 From: Stefan Lay Date: Fri, 6 May 2011 10:42:51 +0200 Subject: Fix getHumanishName broken for windows paths Since d1718a the method getHumanishName was broken on windows since the URIish is not normalized anymore. For a path like "C:\gitRepositories\egit" the whole path was returned instead of "egit". Bug: 343519 Change-Id: I95056009072b99d32f288966302d0f8188b47836 Signed-off-by: Stefan Lay --- .../tst/org/eclipse/jgit/transport/URIishTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'org.eclipse.jgit.test') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java index c86869d088..01d3820184 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java @@ -484,6 +484,17 @@ public class URIishTest { assertEquals("c", humanishName); } + @Test + public void testGetWindowsPathHumanishName() + throws IllegalArgumentException, + URISyntaxException { + if (File.separatorChar == '\\') { + String humanishName = new URIish("file:///C\\a\\b\\c.git/") + .getHumanishName(); + assertEquals("c", humanishName); + } + } + @Test public void testUserPasswordAndPort() throws URISyntaxException { String str = "http://user:secret@host.xy:80/some/path"; -- cgit v1.2.3