diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php index 286cf762a..daab73dfe 100644 --- a/src/Composer/Repository/Vcs/GitDriver.php +++ b/src/Composer/Repository/Vcs/GitDriver.php @@ -169,6 +169,15 @@ class GitDriver extends VcsDriver implements VcsDriverInterface return true; } + // local filesystem + if (preg_match('{^(file://|/|[a-z]:[\\\\/])}', $url)) { + $process = new ProcessExecutor(); + // check whether there is a git repo in that path + if ($process->execute(sprintf('cd %s && git show', escapeshellarg($url)), $output) === 0) { + return true; + } + } + if (!$deep) { return false; } diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index 1d6e82ab3..a2506d2df 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -19,10 +19,6 @@ class VcsRepository extends ArrayRepository public function __construct(array $config, IOInterface $io, array $drivers = null) { - if (!filter_var($config['url'], FILTER_VALIDATE_URL)) { - throw new \UnexpectedValueException('Invalid url given for VCS repository: '.$config['url']); - } - $this->drivers = $drivers ?: array( 'Composer\Repository\Vcs\GitHubDriver', 'Composer\Repository\Vcs\GitBitbucketDriver',