mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Fix abrupt failure mode for uncloned repositories in Diffusion
Summary: Fixes T9080. We try to list alternatives for the current ref (for example, if you're viewing a branch named "master" but there's also a tag named "master", or, in Mercurial, there are several branches named "master") but fail to abruptly if we can't get the list. It's fine if we can't get the list; just continue. This is common when the repository hasn't cloned yet. Test Plan: In a local repository with bad credentials, tried to do anything before and after. Before: completely blocked by error; after: things work normally. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9080 Differential Revision: https://secure.phabricator.com/D14044
This commit is contained in:
parent
a13db0a3ec
commit
28621244ad
1 changed files with 10 additions and 1 deletions
|
@ -302,7 +302,16 @@ final class DiffusionRepositoryController extends DiffusionController {
|
|||
|
||||
$info = null;
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
if ($drequest->getRefAlternatives()) {
|
||||
|
||||
// Try to load alternatives. This may fail for repositories which have not
|
||||
// cloned yet. If it does, just ignore it and continue.
|
||||
try {
|
||||
$alternatives = $drequest->getRefAlternatives();
|
||||
} catch (ConduitClientException $ex) {
|
||||
$alternatives = array();
|
||||
}
|
||||
|
||||
if ($alternatives) {
|
||||
$message = array(
|
||||
pht(
|
||||
'The ref "%s" is ambiguous in this repository.',
|
||||
|
|
Loading…
Reference in a new issue