GitWrapper\GitWorkingCopy::needsMerge PHP Method

needsMerge() public method

If this returns true it means that HEAD has diverged from its remote tracking branch; new commits are present locally as well as on the remote.
public needsMerge ( ) : boolean
return boolean true if HEAD needs to be merged with the remote, false otherwise.
    public function needsMerge()
    {
        if (!$this->isTracking()) {
            throw new GitException('Error: HEAD does not have a remote tracking branch. Cannot check if it is behind.');
        }
        $this->clearOutput();
        $merge_base = (string) $this->run(array('merge-base @ @{u}'));
        $local_sha = (string) $this->run(array('rev-parse @'));
        $remote_sha = (string) $this->run(array('rev-parse @{u}'));
        return $merge_base !== $local_sha && $merge_base !== $remote_sha;
    }