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

Crash on empty repositories #937

Open
RobinBoers opened this issue Aug 18, 2024 · 2 comments
Open

Crash on empty repositories #937

RobinBoers opened this issue Aug 18, 2024 · 2 comments

Comments

@RobinBoers
Copy link

Empty repositories give a 500 with the following error in my logs:

[2024-08-18T22:45:08.116012+02:00] request.CRITICAL: Uncaught PHP Exception GitList\SCM\Exception\CommandException: "fatal: Not a valid object name HEAD " at /home/robinb/domains/git.geheimesite.nl/src/SCM/System/Git/CommandLine.php line 315 {"exception":"[object] (GitList\\SCM\\Exception\\CommandException(code: 0): fatal: Not a valid object name HEAD\n at /home/robinb/domains/git.geheimesite.nl/src/SCM/System/Git/CommandLine.php:315)"} []

I would expect this to show me a message "this repository is empty", similar to cgit, GitHub or GitLab do. Or a 404. Not a 500 at least.

@RobinBoers
Copy link
Author

I would be willing to create a PR to fix this, but I'm unfamiliar with this codebase, so it might take a while.

@klaussilveira
Copy link
Owner

You could catch that exception at the controller and use Symfony's flash message system to give the warning. I really like the idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants