Add support for local paths pointing directly at the .git folder instead of actual repo, refs #3338

main
Jordi Boggiano 8 years ago
parent c7c8335b8b
commit 766c45c047

@ -38,6 +38,7 @@ class GitDriver extends VcsDriver
public function initialize() public function initialize()
{ {
if (Filesystem::isLocalPath($this->url)) { if (Filesystem::isLocalPath($this->url)) {
$this->url = preg_replace('{[\\/]\.git/?$}', '', $this->url);
$this->repoDir = $this->url; $this->repoDir = $this->url;
$cacheUrl = realpath($this->url); $cacheUrl = realpath($this->url);
} else { } else {
@ -219,7 +220,7 @@ class GitDriver extends VcsDriver
*/ */
public static function supports(IOInterface $io, Config $config, $url, $deep = false) public static function supports(IOInterface $io, Config $config, $url, $deep = false)
{ {
if (preg_match('#(^git://|\.git$|git(?:olite)?@|//git\.|//github.com/)#i', $url)) { if (preg_match('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//github.com/)#i', $url)) {
return true; return true;
} }

Loading…
Cancel
Save