mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
Improve behavior for not-yet-created non-cluster repositories
Summary: Fixes T10815. We already recovered reasonably from this for cluster repositories, but not for non-cluster repositories. Test Plan: - Viewed cluster and non-cluster empty Git repository. - Viewed cluster and non-cluster empty Mercurial repository. - Viewed cluster and non-clsuter empty hosted SVN repository. - Viewed cluster and non-cluster empty observed SVN repository. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10815 Differential Revision: https://secure.phabricator.com/D15878
This commit is contained in:
parent
71a97d8af5
commit
3fdb1a2bc4
2 changed files with 14 additions and 0 deletions
|
@ -31,6 +31,11 @@ final class DiffusionLowLevelResolveRefsQuery
|
|||
return array();
|
||||
}
|
||||
|
||||
$repository = $this->getRepository();
|
||||
if (!$repository->hasLocalWorkingCopy()) {
|
||||
return array();
|
||||
}
|
||||
|
||||
switch ($this->getRepository()->getVersionControlSystem()) {
|
||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||
$result = $this->resolveGitRefs();
|
||||
|
|
|
@ -1477,6 +1477,15 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||
return false;
|
||||
}
|
||||
|
||||
public function hasLocalWorkingCopy() {
|
||||
try {
|
||||
self::assertLocalExists();
|
||||
return true;
|
||||
} catch (Exception $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Raise more useful errors when there are basic filesystem problems.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue