From 3d3e63e4fc31eab1b1acdf2197e21e81b2747526 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 19 Mar 2012 16:06:45 -0700 Subject: [PATCH] Fix an issue with empty 'Summary' fields in commit messages Summary: If the 'Summary' is not present and not inferred to be empty from a newline after the title with no explicit 'Summary' field, we'll copy all the field values from the revision (including NULL), not overwrite the 'Summary' value from the message (since it's not present) and then write the NULL back to the revision. Instead, string cast the read from the Revision so we write back empty string in the not-provided case. Test Plan: Ran "arc diff --create --use-commit-message HEAD" with P336 in HEAD, didn't fail (previously, it failed). Reviewers: btrahan, 20after4 Reviewed By: 20after4 CC: aran, epriestley Maniphest Tasks: T1019 Differential Revision: https://secure.phabricator.com/D1956 --- .../summary/DifferentialSummaryFieldSpecification.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/field/specification/summary/DifferentialSummaryFieldSpecification.php b/src/applications/differential/field/specification/summary/DifferentialSummaryFieldSpecification.php index b3afbe7dfb..0dd1cdf98c 100644 --- a/src/applications/differential/field/specification/summary/DifferentialSummaryFieldSpecification.php +++ b/src/applications/differential/field/specification/summary/DifferentialSummaryFieldSpecification.php @@ -1,7 +1,7 @@ summary = $this->getRevision()->getSummary(); + $this->summary = (string)$this->getRevision()->getSummary(); } public function setValueFromRequest(AphrontRequest $request) { @@ -71,7 +71,7 @@ final class DifferentialSummaryFieldSpecification } public function parseValueFromCommitMessage($value) { - return $value; + return (string)$value; } }