diff --git a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php --- a/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php +++ b/src/applications/diffusion/query/DiffusionRenameHistoryQuery.php @@ -36,9 +36,11 @@ $conn_r = id(new PhabricatorRepository())->establishConnection('r'); $commit_id = $this->loadCommitId($this->oldCommit); - $old_commit_sequence = $this->loadCommitSequence($commit_id); - $path = '/'.$drequest->getPath(); + $old_commit_sequence = $this->loadCommitSequence($commit_id); + if ($old_commit_sequence === null) { + return $path; + } $commit_id = $this->loadCommitId($drequest->getCommit()); do { @@ -97,7 +99,10 @@ PhabricatorRepository::TABLE_PATHCHANGE, $this->request->getRepository()->getID(), $commit_id); - return reset($path_change); + if ($path_change !== null) { + return reset($path_change); + } + return null; } }