protected function getDiffLineNumber(Builder $builder, $file, $line)
    {
        $line = (integer)$line;

        $builder->logExecOutput(false);

        $prNumber = $this->getExtra('pull_request_number');
        $path = $builder->buildPath;

        if (!empty($prNumber)) {
            $builder->executeCommand('cd %s && git diff origin/%s "%s"', $path, $this->getBranch(), $file);
        } else {
            $commitId = $this->getCommitId();
            $compare = $commitId == 'Manual' ? 'HEAD' : $commitId;
            $builder->executeCommand('cd %s && git diff %s^^ "%s"', $path, $compare, $file);
        }

        $builder->logExecOutput(true);

        $diff = $builder->getLastOutput();

        $helper = new Diff();
        $lines = $helper->getLinePositions($diff);

        return isset($lines[$line]) ? $lines[$line] : null;
    }