Show a more tailored message when adding empty files
Summary: Fixes T6695. Tailor this message.
Test Plan: {F333305}
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T6695
Differential Revision: https://secure.phabricator.com/D12022
This commit is contained in:
3
src/applications/differential/__tests__/data/empty.diff
Normal file
3
src/applications/differential/__tests__/data/empty.diff
Normal file
@@ -0,0 +1,3 @@
|
||||
diff --git a/empty b/empty
|
||||
new file mode 100644
|
||||
index 0000000..e69de29
|
||||
@@ -0,0 +1,5 @@
|
||||
CTYPE 1 1 (unforced)
|
||||
empty
|
||||
empty
|
||||
-
|
||||
SHIELD (none) This is an empty file.
|
||||
@@ -0,0 +1,5 @@
|
||||
CTYPE 1 1 (unforced)
|
||||
empty
|
||||
empty
|
||||
-
|
||||
SHIELD (none) This is an empty file.
|
||||
@@ -850,9 +850,19 @@ final class DifferentialChangesetParser {
|
||||
// we'll never have it so we need to be prepared to not render a link.
|
||||
$type = 'none';
|
||||
}
|
||||
$shield = $renderer->renderShield(
|
||||
pht('The contents of this file were not changed.'),
|
||||
$type);
|
||||
|
||||
$type_add = DifferentialChangeType::TYPE_ADD;
|
||||
if ($this->changeset->getChangeType() == $type_add) {
|
||||
// Although the generic message is sort of accurate in a technical
|
||||
// sense, this more-tailored message is less confusing.
|
||||
$shield = $renderer->renderShield(
|
||||
pht('This is an empty file.'),
|
||||
$type);
|
||||
} else {
|
||||
$shield = $renderer->renderShield(
|
||||
pht('The contents of this file were not changed.'),
|
||||
$type);
|
||||
}
|
||||
} else if ($this->isWhitespaceOnly()) {
|
||||
$shield = $renderer->renderShield(
|
||||
pht('This file was changed only by adding or removing whitespace.'),
|
||||
|
||||
Reference in New Issue
Block a user