Some git diffs (most likely octopus merges) start with diff --cc,

so we have to detect and stop log parsing when this occurs as well.
feature.diff-whitespace
Thomas Keller 2011-10-09 00:08:16 +02:00
parent b1276dff6c
commit c84afd0f78
1 changed files with 5 additions and 1 deletions

View File

@ -513,7 +513,11 @@ class IDF_Scm_Git extends IDF_Scm
return false;
}
$diffStart = strpos($out, 'diff --git a');
$diffStart = false;
if (preg_match('/^diff (?:--git a|--cc)/m', $out, $m, PREG_OFFSET_CAPTURE)) {
$diffStart = $m[0][1];
}
$diff = '';
if ($diffStart !== false) {
$log = substr($out, 0, $diffStart);