Make SvnDriver::supports less greedy and more realistic
parent
30d4080014
commit
cd2e5bf2e0
|
@ -262,12 +262,13 @@ class SvnDriver extends VcsDriver
|
||||||
*/
|
*/
|
||||||
public static function supports($url, $deep = false)
|
public static function supports($url, $deep = false)
|
||||||
{
|
{
|
||||||
$url = self::fixSvnUrl($url);
|
$url = self::normalizeUrl($url);
|
||||||
if (preg_match('#((^svn://)|(^svn\+ssh://)|(^file:///)|(^http)|(svn\.))#i', $url)) {
|
if (preg_match('#(^svn://|^svn\+ssh://|svn\.)#i', $url)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$deep) {
|
// proceed with deep check for local urls since they are fast to process
|
||||||
|
if (!$deep && !static::isLocalUrl($url)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,15 +58,10 @@ class SvnDriverTest extends \PHPUnit_Framework_TestCase
|
||||||
array('https://svn.sf.net', true),
|
array('https://svn.sf.net', true),
|
||||||
array('svn://example.org', true),
|
array('svn://example.org', true),
|
||||||
array('svn+ssh://example.org', true),
|
array('svn+ssh://example.org', true),
|
||||||
array('file:///d:/repository_name/project', true),
|
|
||||||
array('file:///repository_name/project', true),
|
|
||||||
array('/absolute/path', true),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nail a bug in {@link SvnDriver::support()}.
|
|
||||||
*
|
|
||||||
* @dataProvider supportProvider
|
* @dataProvider supportProvider
|
||||||
*/
|
*/
|
||||||
public function testSupport($url, $assertion)
|
public function testSupport($url, $assertion)
|
||||||
|
|
Loading…
Reference in New Issue