public function parseString($string)
    {
        $lines     = preg_split('(\r\n|\r|\n)', $string);
        $lineCount = count($lines);
        $diffs     = array();
        $diff      = null;
        $collected = array();

        for ($i = 0; $i < $lineCount; ++$i) {
            if (preg_match('(^---\\s+(?P<file>\\S+))', $lines[$i], $fromMatch) &&
                 preg_match('(^\\+\\+\\+\\s+(?P<file>\\S+))', $lines[$i + 1], $toMatch))
            {
                // If a diff already has started, parse the colected lines for
                // the affected diff.
                if ($diff !== null) {
                    $this->parseFileDiff($diff, $collected);
                    $diffs[]   = $diff;
                    $collected = array();
                }

                $diff = new \Arbit\VCSWrapper\Diff\Collection($fromMatch['file'], $toMatch['file']);
                ++$i;
            } else {
                // Collect all lines, which do not indicate a starting diff.
                $collected[] = $lines[$i];
            }
        }

        // We reached the end of the diff, perhaps there are still lines to
        // calcualte a diff from?
        if (count($collected) &&
             ($diff !== null))
        {
            $this->parseFileDiff($diff, $collected);
            $diffs[] = $diff;
        }

        return $diffs;
    }