diff --git a/src/ref/commit/ArcanistMercurialCommitSymbolCommitHardpointQuery.php b/src/ref/commit/ArcanistMercurialCommitSymbolCommitHardpointQuery.php index b561247d..db27e8fb 100644 --- a/src/ref/commit/ArcanistMercurialCommitSymbolCommitHardpointQuery.php +++ b/src/ref/commit/ArcanistMercurialCommitSymbolCommitHardpointQuery.php @@ -159,7 +159,7 @@ final class ArcanistMercurialCommitSymbolCommitHardpointQuery // a spot which a marker might match. foreach ($node_list as $node) { foreach ($symbol_set as $symbol) { - if (str_starts_with($node, $symbol)) { + if (strncmp($node, $symbol, strlen($symbol)) === 0) { if (!isset($hash_map[$symbol])) { $hash_map[$symbol] = $node; } diff --git a/src/repository/api/ArcanistMercurialAPI.php b/src/repository/api/ArcanistMercurialAPI.php index df6bdc1c..7e35a1e3 100644 --- a/src/repository/api/ArcanistMercurialAPI.php +++ b/src/repository/api/ArcanistMercurialAPI.php @@ -672,7 +672,10 @@ final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { public function amendCommit($message = null) { $path_statuses = $this->buildUncommittedStatus(); - if ($message === null) { + $existing_message = $this->getCommitMessage( + $this->getWorkingCopyRevision()); + + if ($message === null || $message == $existing_message) { if (empty($path_statuses)) { // If there are no changes to the working directory and the message is // not being changed then there's nothing to amend. Notably Mercurial