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

Fatal bug: Avoid unintentional conversion of commit hash into a boolean #207

Open
codebymikey opened this issue Jul 18, 2023 · 0 comments
Open

Comments

@codebymikey
Copy link

#192 introduces a breaking change in calls like $file->getOldBlob()->getContent();, and the following exception is thrown:

In Repository.php line 563:

  [Gitonomy\Git\Exception\ProcessException]
  Error while running git command:
  'git' '--git-dir' '/app/application/.git' '--work-tree' '/app/application/redacted' 'cat-file' '-p' '1'

  fatal: Not a valid object name 1

And as originally noted by @stof in the upstream PR, this is because it unintentionally converts all commit hashes into a boolean (which is then converted into a 1):

Proof of concept: https://3v4l.org/tiJvR

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