From 18d3339deb16872a8a0a5c5bf4c30538fa4e6df4 Mon Sep 17 00:00:00 2001 From: Leigh Bicknell Date: Tue, 25 Sep 2018 16:50:37 +0100 Subject: [PATCH] Fix issue when .git file has absolute path --- src/Console/Helper/PathsHelper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Console/Helper/PathsHelper.php b/src/Console/Helper/PathsHelper.php index f112cfcd2..30986a81d 100644 --- a/src/Console/Helper/PathsHelper.php +++ b/src/Console/Helper/PathsHelper.php @@ -170,7 +170,8 @@ public function getGitHooksDir() if (is_file($gitRepoPath)) { $fileContent = $this->fileSystem->readFromFileInfo(new SplFileInfo($gitRepoPath)); if (preg_match('/gitdir:\s+(\S+)/', $fileContent, $matches)) { - return $this->getRelativePath($gitPath . $matches[1] . '/hooks/'); + $relativePath = $this->getRelativePath($matches[1]); + return $this->getRelativePath($gitPath . $relativePath . '/hooks/'); } }