From c30ba572846135e7f99c45aa82b4a3a084fdf59b Mon Sep 17 00:00:00 2001 From: spofa Date: Tue, 21 Jun 2016 13:09:29 +0800 Subject: [PATCH] fix git-dir under certain os such as the windows Under windows if the $gitRoot contains space character or other special characters in it then git will report error " unknow git command" A example is: E:/test test1/test test2/.git --- src/ModmanGenerator/Vcs/Git.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ModmanGenerator/Vcs/Git.php b/src/ModmanGenerator/Vcs/Git.php index 6c25a0a..d3133d3 100644 --- a/src/ModmanGenerator/Vcs/Git.php +++ b/src/ModmanGenerator/Vcs/Git.php @@ -19,7 +19,7 @@ public function getFilesInVcs(array $ignoreFiles = array(), $asPlainText = false { $gitRoot = $this->getRoot() . '/.git'; $ignoreFiles = implode('|', $ignoreFiles); - $files = `git --git-dir=$gitRoot ls-files | grep -vE "($ignoreFiles)"`; + $files = `git --git-dir="$gitRoot" ls-files | grep -vE "($ignoreFiles)"`; return $asPlainText ? $files : explode(PHP_EOL, $files); }