mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Don't choke on copy-pasted diffs which include commit messages
Summary: If you `git show` and copy/paste it into Differential, we die trying to save the DifferentialChangeset corresponding to the commit message (error: column "filename" can not be null). Instead, drop the message change for raw diffs. Test Plan: Copy/pasted `git show` into Differential. Reviewers: btrahan, vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D3740
This commit is contained in:
parent
e14930f860
commit
3a8be549d6
1 changed files with 7 additions and 0 deletions
|
@ -133,6 +133,13 @@ final class DifferentialDiff extends DifferentialDAO {
|
|||
|
||||
$lines = 0;
|
||||
foreach ($changes as $change) {
|
||||
if ($change->getType() == ArcanistDiffChangeType::TYPE_MESSAGE) {
|
||||
// If a user pastes a diff into Differential which includes a commit
|
||||
// message (e.g., they ran `git show` to generate it), discard that
|
||||
// change when constructing a DifferentialDiff.
|
||||
continue;
|
||||
}
|
||||
|
||||
$changeset = new DifferentialChangeset();
|
||||
$add_lines = 0;
|
||||
$del_lines = 0;
|
||||
|
|
Loading…
Reference in a new issue