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

Repository branch compare doesn't work if the branch name contains slashes. #826

Open
vekien opened this issue Feb 7, 2025 · 0 comments

Comments

@vekien
Copy link

vekien commented Feb 7, 2025

Issue

If a branch name has slashes, the compare function does not work and throws an error

Replicate:

<?php

require __DIR__ . "/vendor/autoload.php";

use Gitlab\Client;

$client = new Client();
$client->setUrl("url");
$client->authenticate("token", Client::AUTH_HTTP_TOKEN);

$comparison = $client->repositories()->compare(
    123,
    "fix/branch_name",
    "develop"
);

print_r($comparison);

Thrown:

Fatal error: Uncaught Gitlab\Exception\RuntimeException: 404 Ref Not Found in gitlab-test/vendor/m4tthumphrey/php-gitlab-api/src/HttpClient/Plugin/ExceptionThrower.php:78
Stack trace:
#0 gitlab-test/vendor/m4tthumphrey/php-gitlab-api/src/HttpClient/Plugin/ExceptionThrower.php(53): Gitlab\HttpClient\Plugin\ExceptionThrower::createException(404, '404 Ref Not Fou...')
@vekien vekien changed the title Repository compare doesn't work if the branch name has slashes in it. Repository branch compare doesn't work if the branch name has slashes in it. Feb 7, 2025
@vekien vekien changed the title Repository branch compare doesn't work if the branch name has slashes in it. Repository branch compare doesn't work if the branch name contains slashes. Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant