Skip to content

Commit

Permalink
changed cloneRepository scope to make it publicly usable
Browse files Browse the repository at this point in the history
  • Loading branch information
pitpit committed Jul 29, 2014
1 parent 7a46107 commit 02ad523
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Gitonomy/Git/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public static function mirrorTo($path, $url, array $options = array())
*
* @return Repository
*/
private static function cloneRepository($path, $url, array $args = array(), array $options = array())
public static function cloneRepository($path, $url, array $args = array(), array $options = array())
{
$process = static::getProcess('clone', array_merge(array('-q'), $args, array($url, $path)), $options);

Expand Down
17 changes: 17 additions & 0 deletions tests/Gitonomy/Git/Tests/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,21 @@ public function testExistingFile()

Admin::init($file, true, self::getOptions());
}

public function testCloneRepository()
{
$newDir = self::createTempDir();
$args = array();

$new = Admin::cloneRepository($newDir, self::REPOSITORY_URL, $args, self::getOptions());
self::registerDeletion($new);

$newRefs = array_keys($new->getReferences()->getAll());

$this->assertTrue(in_array('refs/heads/master', $newRefs));
$this->assertTrue(in_array('refs/tags/0.1', $newRefs));

$this->assertEquals($newDir.'/.git', $new->getGitDir());
$this->assertEquals($newDir, $new->getWorkingDir());
}
}

0 comments on commit 02ad523

Please sign in to comment.