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

Openening a file containing the name of a branch or tag throws a CommandException #929

Open
ziebelje opened this issue Jul 12, 2023 · 0 comments
Labels

Comments

@ziebelje
Copy link

Error: request.CRITICAL: Uncaught PHP Exception GitList\SCM\Exception\CommandException: "/usr/bin/git show ia:D/js/component/triage.js" at /data/www/gitlist/src/SCM/System/Git/CommandLine.php line 320 {"exception":"[object] (GitList\\SCM\\Exception\\CommandException(code: 0): /usr/bin/git show ia:D/js/component/triage.js at /data/www/gitlist/src/SCM/System/Git/CommandLine.php:320)"} []

I have a repository that contains a branch named "ia". When browsing HEAD on GitList, I open the file "js/component/text.js". Among other things, GitList generates and executes the following command to get the contents of the file:

/usr/bin/git show HEAD:js/component/text.js

This works fine. I now try to open the file "js/component/triage.js". Among other things, GitList generates and executes the following command to get the contents of the file:

/usr/bin/git show ia:D/js/component/triage.js

Clearly this is wrong. I traced this down to the Repository/Commitish.php constructor. Specifically, it is changing $this->hash to the name of the rev (a branch named "ia" in this case) and ultimately getting set incorrectly.

I don't fully understand the purpose of this code, but reproduced this issue on several filenames containing the string "ia" in them. Confirmed that removing this branch fixed the issue.

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

No branches or pull requests

2 participants