1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Set project's ObjectName to its PHID when it doesn't have a hashtag

Summary: Fixes T12659. Previously this would lead to an error when trying to run `arc diff` on a revision that had a milestone as a reviewer (or any non-octothorpe'd Object Name)

Test Plan: Followed repro steps in T12659 and didn't get the error described. Also clicked around and didn't notice any obvious regressions in projects or differential

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, yelirekim

Maniphest Tasks: T12659

Differential Revision: https://secure.phabricator.com/D17807
This commit is contained in:
Josh Cox 2017-04-05 06:08:14 -04:00
parent b7c4f60e23
commit f2ca348b3a

View file

@ -47,6 +47,10 @@ final class PhabricatorProjectProjectPHIDType extends PhabricatorPHIDType {
$handle->setObjectName('#'.$slug);
$handle->setURI("/tag/{$slug}/");
} else {
// We set the name to the project's PHID to avoid a parse error when a
// project has no hashtag (as is the case with milestones by default).
// See T12659 for more details
$handle->setCommandLineObjectName($project->getPHID());
$handle->setURI("/project/view/{$id}/");
}