@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+10 -1
+10 -1
src/applications/diffusion/controller/DiffusionRepositoryController.php
··· 302 302 303 303 $info = null; 304 304 $drequest = $this->getDiffusionRequest(); 305 - if ($drequest->getRefAlternatives()) { 305 + 306 + // Try to load alternatives. This may fail for repositories which have not 307 + // cloned yet. If it does, just ignore it and continue. 308 + try { 309 + $alternatives = $drequest->getRefAlternatives(); 310 + } catch (ConduitClientException $ex) { 311 + $alternatives = array(); 312 + } 313 + 314 + if ($alternatives) { 306 315 $message = array( 307 316 pht( 308 317 'The ref "%s" is ambiguous in this repository.',