diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php --- a/src/repository/api/ArcanistGitAPI.php +++ b/src/repository/api/ArcanistGitAPI.php @@ -1054,7 +1054,12 @@ } public function getBaseCommitRef() { - $base_commit = $this->getSourceControlBaseRevision(); + $base_commit = $this->getBaseCommit(); + + if ($base_commit === self::GIT_MAGIC_ROOT_COMMIT) { + return null; + } + $base_message = $this->getCommitMessage($base_commit); // TODO: We should also pull the tree hash. diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -596,6 +596,20 @@ return $refs; } + public function getBaseCommitRef() { + $base_commit = $this->getBaseCommit(); + + if ($base_commit === 'null') { + return null; + } + + $base_message = $this->getCommitMessage($base_commit); + + return $this->newCommitRef() + ->setCommitHash($base_commit) + ->attachMessage($base_message); + } + public function hasLocalCommit($commit) { try { $this->getCanonicalRevisionName($commit);