Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab: detect repository functionality disabled in Driver #10440

Merged
merged 1 commit into from Jan 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Composer/Repository/Vcs/GitLabDriver.php
Expand Up @@ -504,6 +504,11 @@ protected function getContents($url, $fetchingRepoData = false)

// force auth as the unauthenticated version of the API is broken
if (!isset($json['default_branch'])) {
// GitLab allows you to disable the repository inside a project to use a project only for issues and wiki
if (isset($json['repository_access_level']) && $json['repository_access_level'] === 'disabled') {
throw new TransportException('The GitLab repository is disabled in the project', 400);
}

if (!empty($json['id'])) {
$this->isPrivate = false;
}
Expand Down