mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-25 23:10:57 +01:00
Improve handling of bad branches in Diffusion
Summary: Fixes T7972. - Trap the RefNotFound error which may occur in `getAlternatives()`. - Improve error handling in Mercurial. Test Plan: {F387611} Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7972 Differential Revision: https://secure.phabricator.com/D12590
This commit is contained in:
parent
d816ac0b01
commit
ced20d48ea
2 changed files with 10 additions and 1 deletions
src/applications/diffusion
|
@ -204,6 +204,10 @@ final class DiffusionLowLevelResolveRefsQuery
|
|||
// unclear how to best do that. For now, treat it as a miss instead.
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/unknown revision/', $ex->getStdErr())) {
|
||||
// No matches for this ref.
|
||||
continue;
|
||||
}
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
|
|
|
@ -755,7 +755,12 @@ abstract class DiffusionRequest {
|
|||
|
||||
public function getRefAlternatives() {
|
||||
// Make sure we've resolved the reference into a stable commit first.
|
||||
try {
|
||||
$this->getStableCommit();
|
||||
} catch (DiffusionRefNotFoundException $ex) {
|
||||
// If we have a bad reference, just return the empty set of
|
||||
// alternatives.
|
||||
}
|
||||
return $this->refAlternatives;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue