[PATCH] D129232: [llvm][docs] add another patch for `arc patch` fix

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 15:42:23 PDT 2022


ychen added a comment.

I accumulated these in my local arcanist copy. Feel free to apply as well :-)

  diff --git a/src/differential/ArcanistDifferentialDependencyGraph.php b/src/differential/ArcanistDifferentialDependencyGraph.php
  index 64e2f9c7..b5613808 100644
  --- a/src/differential/ArcanistDifferentialDependencyGraph.php
  +++ b/src/differential/ArcanistDifferentialDependencyGraph.php
  @@ -42,7 +42,7 @@ final class ArcanistDifferentialDependencyGraph extends AbstractDirectedGraph {
       $edges = array();
       foreach ($dependencies as $dependency) {
         $dependency_revision = $this->getCommitHashFromDict($dependency);
  -      if ($repository_api->hasLocalCommit($dependency_revision)) {
  +      if (phutil_nonempty_string($dependency_revision) && $repository_api->hasLocalCommit($dependency_revision)) {
           $edges[$dependency['phid']] = array();
           continue;
         }
  diff --git a/src/lint/linter/ArcanistScriptAndRegexLinter.php b/src/lint/linter/ArcanistScriptAndRegexLinter.php
  index 0c3d9d9a..b9f6924e 100644
  --- a/src/lint/linter/ArcanistScriptAndRegexLinter.php
  +++ b/src/lint/linter/ArcanistScriptAndRegexLinter.php
  @@ -338,7 +338,7 @@ final class ArcanistScriptAndRegexLinter extends ArcanistLinter {
       }
   
       $line = idx($match, 'line');
  -    if (strlen($line)) {
  +    if (phutil_nonempty_string($line) && strlen($line)) {
         $line = (int)$line;
         if (!$line) {
           $line = 1;
  diff --git a/src/repository/api/ArcanistGitAPI.php b/src/repository/api/ArcanistGitAPI.php
  index 6c6d2ac4..4a17f5f2 100644
  --- a/src/repository/api/ArcanistGitAPI.php
  +++ b/src/repository/api/ArcanistGitAPI.php
  @@ -1143,7 +1143,7 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
   
     public function hasLocalCommit($commit) {
       try {
  -      if (!$this->getCanonicalRevisionName($commit)) {
  +      if (!phutil_nonempty_string($commit) || !$this->getCanonicalRevisionName($commit)) {
           return false;
         }
       } catch (CommandException $exception) {


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129232/new/

https://reviews.llvm.org/D129232



More information about the llvm-commits mailing list