mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
fix bug in GlobUtil
This commit is contained in:
@@ -190,6 +190,6 @@ public class GlobUtil
|
|||||||
*/
|
*/
|
||||||
public static boolean matches(String glob, String value)
|
public static boolean matches(String glob, String value)
|
||||||
{
|
{
|
||||||
return value.matches(convertGlobToRegEx(value));
|
return value.matches(convertGlobToRegEx(glob));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ public class GlobUtilTest
|
|||||||
@Test
|
@Test
|
||||||
public void matchesTest()
|
public void matchesTest()
|
||||||
{
|
{
|
||||||
assertTrue(GlobUtil.matches("/test/path/somefile.txt", "/test/path/*"));
|
assertTrue(GlobUtil.matches("/test/path/*", "/test/path/somefile.txt"));
|
||||||
assertTrue(GlobUtil.matches("/test/path/somefile.txt", "*/somefile.txt"));
|
assertTrue(GlobUtil.matches("*/somefile.txt", "/test/path/somefile.txt"));
|
||||||
assertTrue(GlobUtil.matches("asd", "a*d"));
|
assertTrue(GlobUtil.matches("a*d", "asd"));
|
||||||
assertTrue(GlobUtil.matches("asd", "a?d"));
|
assertTrue(GlobUtil.matches("a?d", "asd"));
|
||||||
assertFalse(GlobUtil.matches("asd", "a\\*d"));
|
assertFalse(GlobUtil.matches("a\\*d", "asd"));
|
||||||
assertFalse(GlobUtil.matches("asd", "a\\?d"));
|
assertFalse(GlobUtil.matches("a\\?d", "asd"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user