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\UtilCode
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;
}