Skip to content

Commit

Permalink
GitRepository: cloneRepository() - added argument $params
Browse files Browse the repository at this point in the history
  • Loading branch information
janpecha committed Oct 24, 2016
1 parent a582eff commit 18239c8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,10 @@ public static function init($directory, array $params = NULL)
* Clones GIT repository from $url into $directory
* @param string
* @param string|NULL
* @param array|NULL
* @return self
*/
public static function cloneRepository($url, $directory = NULL)
public static function cloneRepository($url, $directory = NULL, array $params = NULL)
{
if($directory !== NULL && is_dir("$directory/.git"))
{
Expand All @@ -610,7 +611,16 @@ public static function cloneRepository($url, $directory = NULL)
$directory = "$cwd/$directory";
}

exec('git clone -q ' . escapeshellarg($url) . ' ' . escapeshellarg($directory), $output, $returnCode);
if ($params === NULL) {
$params = '-q';
}

exec(self::processCommand(array(
'git clone',
$params,
$url,
$directory
)), $output, $returnCode);

if($returnCode !== 0)
{
Expand Down

0 comments on commit 18239c8

Please sign in to comment.