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

Failed to get commit HEAD - NullPointerException #365

Closed
gitblit opened this issue Aug 12, 2015 · 5 comments
Closed

Failed to get commit HEAD - NullPointerException #365

gitblit opened this issue Aug 12, 2015 · 5 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 69

What steps will reproduce the problem?
1. Create empty repository
2. Create simple pre-receive hook denying CREATE command
3. PUSH new MASTER branch
4. Do anything with the REPO -> NPE

What is the expected output? What do you see instead?
GitBlit now handles the repository as non-empty. However it has problems getting HEAD
ref as it does not have any (its creation was blocked).

What version of the product are you using? On what operating system?
GitBlit 0.8.2

Please provide any additional information below.
Not sure whether the pre-receive hook has anything to do with the NPE. However the
UI started to handle repository as a non-empty after the rejected push. So there might
be actually two bugs (check the last exception in the attached log file).

This is not a severe error as the application is able to work. Still, it is an ugly
NPE in the log file.

Reported by horal.pavel on 2012-02-23 18:54:54


- _Attachment: [security.groovy](https://storage.googleapis.com/google-code-attachments/gitblit/issue-69/comment-0/security.groovy)_ - _Attachment: [catalina.out](https://storage.googleapis.com/google-code-attachments/gitblit/issue-69/comment-0/catalina.out)_
@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I didn't check closed issues. The issue 310 is about the exactly same exception. Still
I feel that this might be a little bit different context as the issue 310 should have
been fixed.

Reported by horal.pavel on 2012-02-23 19:02:10

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

This is a sneaky one.  It is not exactly the same as issue 310.  This exception is thrown
because the repository has commits but HEAD remains unlinked.  This exception will
be thrown on the first commit to any empty repository.  This is a side-effect of peeking
at the repository during push - which Gitblit did not do prior to 0.8.0.

My fix for issue 310 was to manually check the repository for loose/packed objects.
 That ensured that commits were available and assumed that HEAD was linked to one of
them, but in this case HEAD is still unlinked.

Reported by James.Moger on 2012-02-23 22:33:10

  • Status changed: Accepted
  • Labels added: Milestone-0.9.0

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Reported by James.Moger on 2012-02-24 00:51:30

  • Status changed: Queued

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Fixed in v0.9.1

Reported by James.Moger on 2012-03-28 00:02:10

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Fixed in v0.9.1. Closing.

Reported by James.Moger on 2012-03-28 00:03:13

  • Status changed: Fixed

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 0.9.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants