Skip to content

Commit

Permalink
Update behavior between --reabse and --ensure-sync options
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Aug 29, 2016
1 parent 01e29b1 commit d9d4aeb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Operation/RemoteMergeOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public function pushToRemote()
public function rebase(bool $rebase = false)
{
$this->rebase = $rebase;
$this->guardSync = !$rebase;

return $this;
}
Expand Down Expand Up @@ -206,13 +205,7 @@ private function createSourceBranch()

throw new MergeWorkflowException(sprintf('Git rebase failed while trying to synchronize history against "%s".', $this->targetBase), 0, $e);
}

// Retrieve the commits again
$currentBaseHeadCommit = $this->processHelper->runCommand(['git', 'rev-parse', $this->targetBase]);
$lastKnownCommonCommit = $this->processHelper->runCommand(['git', 'merge-base', '--fork-point', $this->targetBase, $sourceBranch]);
}

if ($this->guardSync && $currentBaseHeadCommit !== $lastKnownCommonCommit) {
} elseif ($this->guardSync) {
throw new MergeWorkflowException(sprintf('Failed while trying to perform merge against "%s", history is out of sync.', $this->targetBase));
}
}
Expand Down

0 comments on commit d9d4aeb

Please sign in to comment.