/**
  * Determine why autoclose should be skipped for a commit.
  *
  * This method gives a detailed reason why autoclose will be skipped. To
  * perform a simple test, use @{method:shouldAutocloseCommit}.
  *
  * @param PhabricatorRepositoryCommit Commit to check.
  * @return const|null Constant identifying reason to skip this commit, or null
  *   if autoclose is active.
  * @task autoclose
  */
 public function shouldSkipAutocloseCommit(PhabricatorRepositoryCommit $commit)
 {
     $all_reason = $this->shouldSkipAllAutoclose();
     if ($all_reason) {
         return $all_reason;
     }
     switch ($this->getVersionControlSystem()) {
         case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
         case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
             return null;
         case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
             break;
         default:
             throw new Exception(pht('Unrecognized version control system.'));
     }
     $closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE;
     if (!$commit->isPartiallyImported($closeable_flag)) {
         return self::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH;
     }
     return null;
 }