Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Git.php

function Git::checkRefIsInMirror

1 call to Git::checkRefIsInMirror()
Git::fetchRefOrSyncMirror in vendor/composer/composer/src/Composer/Util/Git.php

File

vendor/composer/composer/src/Composer/Util/Git.php, line 461

Class

Git
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Util

Code

private function checkRefIsInMirror(string $dir, string $ref) : bool {
    if (is_dir($dir) && 0 === $this->process
        ->execute([
        'git',
        'rev-parse',
        '--git-dir',
    ], $output, $dir) && trim($output) === '.') {
        $exitCode = $this->process
            ->execute([
            'git',
            'rev-parse',
            '--quiet',
            '--verify',
            $ref . '^{commit}',
        ], $ignoredOutput, $dir);
        if ($exitCode === 0) {
            return true;
        }
    }
    self::checkForRepoOwnershipError($this->process
        ->getErrorOutput(), $dir);
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal