Skip to content

Commit

Permalink
fix git-dir under certain os such as the windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
spofa authored Jun 21, 2016
1 parent 0b8b540 commit c30ba57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModmanGenerator/Vcs/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit c30ba57

Please sign in to comment.