From 766c45c0479395b3662399016b95323492f431c6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 21 Apr 2016 11:00:03 +0100 Subject: [PATCH] Add support for local paths pointing directly at the .git folder instead of actual repo, refs #3338 --- src/Composer/Repository/Vcs/GitDriver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php index e9730412d..e98858abc 100644 --- a/src/Composer/Repository/Vcs/GitDriver.php +++ b/src/Composer/Repository/Vcs/GitDriver.php @@ -38,6 +38,7 @@ class GitDriver extends VcsDriver public function initialize() { if (Filesystem::isLocalPath($this->url)) { + $this->url = preg_replace('{[\\/]\.git/?$}', '', $this->url); $this->repoDir = $this->url; $cacheUrl = realpath($this->url); } else { @@ -219,7 +220,7 @@ class GitDriver extends VcsDriver */ 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; }