Skip to content

Commit 2705f38

Browse files
authored
local:clone - adding "--branch" option to specify cloning a particular multidev branch (#2648)
* local:clone - adding "--branch" option to specify cloning a particular git (multidev) branch * Per Pantheon engineer request: Modified the options to make "master" the default value, then always assigning $devBranch to that value, whether specified or not.
1 parent 2669769 commit 2705f38

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Commands/Local/CloneCommand.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,18 @@ class CloneCommand extends TerminusCommand implements SiteAwareInterface, Config
3737
*
3838
* @option site_dir Custom directory for the local copy. By default, the site name is used
3939
* @option override Override the local copy if exists
40+
* @option branch The branch to clone. Default is master
4041
*
4142
* @usage <site> Clone's a local copy into "$HOME/pantheon-local-copies"
4243
*/
43-
public function clone(string $site_id, array $options = ['site_dir' => null, 'override' => null]): string
44+
public function clone(string $site_id, array $options = ['site_dir' => null, 'override' => null, 'branch' => 'master']): string
4445
{
4546
$site = $this->getSiteById($site_id);
4647
$env = $site->getEnvironments()->get('dev');
4748

4849
$gitUrl = $env->connectionInfo()['git_url'] ?? null;
4950
$localCopyDir = $site->getLocalCopyDir($options['site_dir'] ?? null);
50-
51-
// @todo This value should come from somewhere else.
52-
$devBranch = 'master';
51+
$devBranch = $options['branch'];
5352

5453
try {
5554
/** @var \Pantheon\Terminus\Helpers\LocalMachineHelper $localMachineHelper */

0 commit comments

Comments
 (0)