diff --git a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php index 41092c1030..56826186a1 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php @@ -247,6 +247,11 @@ final class PhabricatorRepositoryRefEngine '{node}\n', hgsprintf('%s', $new_head)); } + + $stdout = trim($stdout); + if (!strlen($stdout)) { + return array(); + } return phutil_split_lines($stdout, $retain_newlines = false); case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: if ($all_closing_heads) { @@ -261,6 +266,11 @@ final class PhabricatorRepositoryRefEngine '%H', $new_head); } + + $stdout = trim($stdout); + if (!strlen($stdout)) { + return array(); + } return phutil_split_lines($stdout, $retain_newlines = false); default: throw new Exception(pht('Unsupported VCS "%s"!', $vcs));