Skip to content

Commit

Permalink
Merge pull request #125 from xboston/patch-1
Browse files Browse the repository at this point in the history
SCM: Git clone performance
  • Loading branch information
andres-montanez committed Oct 11, 2014
2 parents 97e9fde + b066368 commit 8524de7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Mage/Task/BuiltIn/Scm/CloneTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,12 @@ public function run()
$this->runCommandLocal('mkdir -p ' . $this->source['temporal']);
switch ($this->source['type']) {
case 'git':
// Clone Repo
// Fast clone Repo form Branch
$command = 'cd ' . $this->source['temporal'] . ' ; '
. 'git clone ' . $this->source['repository'] . ' . ';
. 'git clone --depth 1 -q -b ' . $this->source['from']
. ' ' . $this->source['repository'] . ' . ';
$result = $this->runCommandLocal($command);

// Checkout Branch
$command = 'cd ' . $this->source['temporal'] . ' ; '
. 'git checkout ' . $this->source['from'];
$result = $result && $this->runCommandLocal($command);

$this->getConfig()->setFrom($this->source['temporal']);
break;

Expand All @@ -84,4 +80,4 @@ public function run()

return $result;
}
}
}

0 comments on commit 8524de7

Please sign in to comment.