Skip to content

Commit 89533fc

Browse files
committed
Added options to cloneTo to also allow passting of git cli arguments
1 parent 54b0610 commit 89533fc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Gitonomy/Git/Admin.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ public static function isValidRepository($url, array $options = [])
7474
* @param string $url url of repository to clone
7575
* @param bool $bare indicates if repository should be bare or have a working copy
7676
* @param array $options options for Repository creation
77+
* @param array $args arguments to be added to the command-line
7778
*
7879
* @return Repository
7980
*/
80-
public static function cloneTo($path, $url, $bare = true, array $options = [])
81+
public static function cloneTo($path, $url, $bare = true, array $options = [], array $args = [])
8182
{
82-
$args = $bare ? ['--bare'] : [];
83+
$args = array_merge($args,$bare ? ['--bare'] : []);
8384

8485
return static::cloneRepository($path, $url, $args, $options);
8586
}

src/Gitonomy/Git/Repository.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,14 @@ public function getLogger()
608608
*
609609
* @param string $path path to the new repository in which current repository will be cloned
610610
* @param bool $bare flag indicating if repository is bare or has a working-copy
611+
* @param array $options options for Repository creation
612+
* @param array $args arguments to be added to the command-line
611613
*
612614
* @return Repository the newly created repository
613615
*/
614-
public function cloneTo($path, $bare = true, array $options = [])
616+
public function cloneTo($path, $bare = true, array $options = [], array $args = [])
615617
{
616-
return Admin::cloneTo($path, $this->gitDir, $bare, $options);
618+
return Admin::cloneTo($path, $this->gitDir, $bare, $options, $args);
617619
}
618620

619621
/**

0 commit comments

Comments
 (0)