コード例 #1
0
 /**
  * clone url
  */
 public function testPull()
 {
     $pc = PullCommand::getInstance();
     $this->assertEquals("pull", $pc->pull());
     $this->assertEquals("pull 'github'", $pc->pull('github'));
     $this->assertEquals("pull 'github' 'develop'", $pc->pull('github', 'develop'));
     $this->getRepository()->addRemote('test-remote', 'git@github.com:matteosister/GitElephant.git');
     $remote = m::mock('GitElephant\\Objects\\Remote')->shouldReceive('getName')->andReturn('test-remote')->getMock();
     $this->assertEquals("pull 'test-remote' 'develop'", $pc->pull($remote, 'develop'));
     $branch = Branch::create($this->getRepository(), 'test-branch');
     $this->assertEquals("pull 'test-remote' 'test-branch'", $pc->pull($remote, $branch));
     $this->assertEquals("pull '--rebase'", $pc->pull(null, null, true));
     $this->assertEquals("pull '--rebase' 'test-remote' 'test-branch'", $pc->pull($remote, $branch, true));
 }
コード例 #2
0
ファイル: Repository.php プロジェクト: mlukman/gitsync
 /**
  * Fetch from and merge with another repository or a local branch
  *
  * @param string $from
  * @param string $ref
  * @param bool   $rebase
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  */
 public function pull($from = null, $ref = null, $rebase = true)
 {
     $this->caller->execute(PullCommand::getInstance($this)->pull($from, $ref, $rebase));
 }