mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 07:11:04 +01:00
Fix an intradiff error when the newer changeset does not exist
Summary: Ref T13523. If a file hasn't been touched in the newer changeset, we can currently hit an error in the interdiff. Test Plan: - Touched "moo.txt" in Diff 1. - Reverted the changes to "moo.txt" in Diff 2. - Diffed 2 vs 1. - Before patch: fatal (call to getFilename() on null). - After patch: clean interdiff. Maniphest Tasks: T13523 Differential Revision: https://secure.phabricator.com/D21220
This commit is contained in:
parent
07e160bde1
commit
6430d6d638
1 changed files with 5 additions and 1 deletions
|
@ -560,12 +560,16 @@ final class DifferentialChangeset
|
||||||
$right_state = $right->hasNewState();
|
$right_state = $right->hasNewState();
|
||||||
$shared_metadata = $right->getMetadata();
|
$shared_metadata = $right->getMetadata();
|
||||||
$right_type = $right->getNewFileType();
|
$right_type = $right->getNewFileType();
|
||||||
|
|
||||||
|
$file_name = $right->getFilename();
|
||||||
} else {
|
} else {
|
||||||
$right_data = $left->makeOldFile();
|
$right_data = $left->makeOldFile();
|
||||||
$right_properties = $left->getOldProperties();
|
$right_properties = $left->getOldProperties();
|
||||||
$right_metadata = $left->getOldStateMetadata();
|
$right_metadata = $left->getOldStateMetadata();
|
||||||
$right_state = $left->hasOldState();
|
$right_state = $left->hasOldState();
|
||||||
$right_type = $left->getOldFileType();
|
$right_type = $left->getOldFileType();
|
||||||
|
|
||||||
|
$file_name = $left->getFilename();
|
||||||
}
|
}
|
||||||
|
|
||||||
$engine = new PhabricatorDifferenceEngine();
|
$engine = new PhabricatorDifferenceEngine();
|
||||||
|
@ -578,7 +582,7 @@ final class DifferentialChangeset
|
||||||
->makeEphemeral(true)
|
->makeEphemeral(true)
|
||||||
->attachDiff($left->getDiff())
|
->attachDiff($left->getDiff())
|
||||||
->setOldFile($left->getFilename())
|
->setOldFile($left->getFilename())
|
||||||
->setFilename($right->getFilename());
|
->setFilename($file_name);
|
||||||
|
|
||||||
// TODO: Change type?
|
// TODO: Change type?
|
||||||
// TODO: Away paths?
|
// TODO: Away paths?
|
||||||
|
|
Loading…
Reference in a new issue