Skip to content
This repository has been archived by the owner on Jan 29, 2019. It is now read-only.

Commit

Permalink
added branch to git pull call
Browse files Browse the repository at this point in the history
  • Loading branch information
fieg committed Oct 31, 2013
1 parent 3c3e1ff commit eaec8e1
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/Webcreate/Vcs/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function checkout($dest = null)
$head = $this->getHead();
$branch = $head->getName();

$this->dispatch(VcsEvents::PRE_CHECKOUT, array('dest' => $realdest, 'head' => $head->getName()));
$this->dispatch(VcsEvents::PRE_CHECKOUT, array('dest' => $realdest, 'head' => $branch));

if (false === $this->hasClone || false === is_null($dest)) {
$this->cloneRepository($dest);
Expand All @@ -89,7 +89,7 @@ public function checkout($dest = null)

$this->hasCheckout = true;

$result = $this->pull();
$result = $this->pull('origin', $branch);

$this->dispatch(VcsEvents::POST_CHECKOUT);
}
Expand Down Expand Up @@ -173,13 +173,6 @@ public function export($path, $dest)
$this->dispatch(VcsEvents::PRE_EXPORT);

if (!$this->hasCheckout) {
// if ($this->isTemporary) {
// // create a shallow checkout
// $result = $this->execute('clone', array('-b' => (string) $branch, '--depth=1', $this->url, $dest));
// } else {
// $this->checkout();
// }

$this->checkout();
}

Expand All @@ -188,8 +181,6 @@ public function export($path, $dest)

$result = $this->adapter->execute('submodule', array('update', '--init' => true, '--recursive' => true), $dest);

//$this->isTemporary = false;

$filesystem = new Filesystem();
$filesystem->remove($dest . '/.git');

Expand Down Expand Up @@ -396,16 +387,17 @@ public function push($remote = 'origin')
* Git pull
*
* @param string $remote
* @param string $branch
* @throws \RuntimeException
* @return string
*/
public function pull($remote = 'origin')
public function pull($remote = 'origin', $branch = 'master')
{
if (!$this->hasCheckout) {
throw new \RuntimeException('This operation requires an active checkout.');
}

return $this->execute('pull', array($remote));
return $this->execute('pull', array($remote, $branch));
}

/**
Expand Down

0 comments on commit eaec8e1

Please sign in to comment.