private function getDefaultRefName(PhabricatorRepository $repository, DifferentialDiff $diff) { $onto = $diff->loadTargetBranch(); if ($onto !== null) { return $onto; } return $repository->getDefaultBranch(); }
private function getBranchDescription(DifferentialDiff $diff) { $branch = $diff->getBranch(); $bookmark = $diff->getBookmark(); if (strlen($branch) && strlen($bookmark)) { return pht('%s (bookmark) on %s (branch)', $bookmark, $branch); } else { if (strlen($bookmark)) { return pht('%s (bookmark)', $bookmark); } else { if (strlen($branch)) { $onto = $diff->loadTargetBranch(); if (strlen($onto) && $onto !== $branch) { return pht('%s (branched from %s)', $branch, $onto); } else { return $branch; } } else { return null; } } } }