Page MenuHomePhabricator

D18811.id45132.diff
No OneTemporary

D18811.id45132.diff

diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -46,8 +46,20 @@
->withRepositoryPHIDs(array($repository->getPHID()))
->withRefTypes(array(PhabricatorRepositoryRefCursor::TYPE_BRANCH))
->withRefNames(array($drequest->getBranch()))
+ ->needPositions(true)
->execute();
- if ($ref_cursors) {
+
+ // It's possible that this branch previously existed, but has been
+ // deleted. Make sure we have valid cursor positions, not just cursors.
+ $any_positions = false;
+ foreach ($ref_cursors as $ref_cursor) {
+ if ($ref_cursor->getPositions()) {
+ $any_positions = true;
+ break;
+ }
+ }
+
+ if ($any_positions) {
// This is a valid branch, so we necessarily have some content.
$page_has_content = true;
} else {

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 9, 7:28 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6275204
Default Alt Text
D18811.id45132.diff (1 KB)

Event Timeline