1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

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
This commit is contained in:
epriestley 2012-03-19 16:06:45 -07:00
parent 81fc0b8843
commit 3d3e63e4fc

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ final class DifferentialSummaryFieldSpecification
}
protected function didSetRevision() {
$this->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;
}
}