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

Breadcrumb

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

function Git::checkForRepoOwnershipError

Parameters

IOInterface|null $io If present, a warning is output there instead of throwing, so pass this in only for cases where this is a soft failure:

4 calls to Git::checkForRepoOwnershipError()
Git::checkRefIsInMirror in vendor/composer/composer/src/Composer/Util/Git.php
Git::syncMirror in vendor/composer/composer/src/Composer/Util/Git.php
GitDriver::supports in vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php
@inheritDoc
VersionGuesser::guessGitVersion in vendor/composer/composer/src/Composer/Package/Version/VersionGuesser.php

File

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

Class

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

Namespace

Composer\Util

Code

public static function checkForRepoOwnershipError(string $output, string $path, ?IOInterface $io = null) : void {
    if (str_contains($output, 'fatal: detected dubious ownership')) {
        $msg = 'The repository at "' . $path . '" does not have the correct ownership and git refuses to use it:' . PHP_EOL . PHP_EOL . $output;
        if ($io === null) {
            throw new \RuntimeException($msg);
        }
        $io->writeError('<warning>' . $msg . '</warning>');
    }
}
RSS feed
Powered by Drupal