mergeBranch() публичный Метод

public mergeBranch ( string $base, string $sourceBranch, string $commitMessage, boolean $fastForward = false ) : null | string
$base string The base branch name
$sourceBranch string The source branch name
$commitMessage string Commit message to use for the merge-commit
$fastForward boolean Perform merge using fast-forward (default false)
Результат null | string The merge-commit hash or null when fast-forward was used
Пример #1
0
 /**
  * @test
  */
 public function merges_remote_branch_fast_forward_in_clean_wc()
 {
     $base = 'master';
     $sourceBranch = 'amazing-feature';
     $processHelper = $this->prophesize('Gush\\Helper\\ProcessHelper');
     $this->unitGit = new GitHelper($processHelper->reveal(), $this->gitConfigHelper->reveal(), $this->filesystemHelper->reveal());
     $processHelper->runCommand('git status --porcelain --untracked-files=no')->willReturn("\n");
     $processHelper->runCommand('git rev-parse --abbrev-ref HEAD')->willReturn('master');
     $processHelper->runCommand(['git', 'checkout', 'master'])->shouldBeCalled();
     $processHelper->runCommand(['git', 'merge', '--ff', 'amazing-feature'])->shouldBeCalled();
     $this->assertNull($this->unitGit->mergeBranch($base, $sourceBranch, null, true));
 }