Permalink
Browse files

fixed VersionControl_Git::initRepository() that doesn't create bare r…

…epository in before Git 1.5.5.6 (fixes #17404)
  • Loading branch information...
1 parent d3f834f commit 7bdfa37e7a8208fac8606e58b9b63f6128dc7084 Kousuke Ebihara committed May 18, 2010
Showing with 15 additions and 4 deletions.
  1. +15 −4 VersionControl/Git.php
View
@@ -159,10 +159,21 @@ public function createClone($repository, $isBare = false, $directory = null)
*/
public function initRepository($isBare = false)
{
- $this->getCommand('init')
- ->setOption('bare', $isBare)
- ->setOption('q')
- ->execute();
+ if (!$isBare || version_compare('1.5.6.6', $this->getGitVersion(), '<='))
+ {
+ $this->getCommand('init')
+ ->setOption('bare', $isBare)
+ ->setOption('q')
+ ->execute();
+ }
+ else
+ {
+ // see: http://git.kernel.org/?p=git/git.git;a=commit;h=74d3b23
+ $this->getCommand('--bare')
+ ->addArgument('init')
+ ->addArgument('-q') // it is just a quick hack
+ ->execute();
+ }
}
/**

0 comments on commit 7bdfa37

Please sign in to comment.