1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Make differential revision ID parsing more robust

Summary:
If something that doesn't belong to any field appears in the commit message
below the differential revision field, it gets included as part of the
value for the field, which can mess up parsing.

Test Plan:
called differential.parsecommitmessage on a commit whose differential
revision field wasn't being parsed earlier (it had a line of dashes two
lines below the Differential Revision: line).

Reviewers: epriestley, vrana

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4171
This commit is contained in:
Nick Harper 2012-12-12 17:43:12 -08:00
parent cce5ebebe9
commit e7bcdcdb94

View file

@ -38,7 +38,7 @@ final class DifferentialRevisionIDFieldSpecification
} }
public function parseValueFromCommitMessage($value) { public function parseValueFromCommitMessage($value) {
$rev = trim($value); $rev = trim(head(explode("\n", $value)));
if (!strlen($rev)) { if (!strlen($rev)) {
return null; return null;