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

NPE: when pushing changes to newly forked repo #549

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

NPE: when pushing changes to newly forked repo #549

gitblit opened this issue Aug 12, 2015 · 5 comments

Comments

@gitblit
Copy link
Owner

@gitblit gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 253

What steps will reproduce the problem?
1. fork a repo
2. clone new repo locally
3. make/commit/push new change
4. GitBlit shows a NullPointerException

For the client, I use TortoiseGit, but this also happens on the command line.
If I restart the GitBlit server, then try to push, the command completes successfully.


What is the expected output? What do you see instead?
The expected output is for the push to complete. 

The server console shows:

INFO  ralim authenticated by BASIC request header from 10.244.140.66
INFO  ARF: ~ralim/ue_tracker.git/info/refs?service=git-receive-pack (100) authen
ticated
INFO  ralim authenticated by BASIC request header from 10.244.140.66
INFO  ARF: ~ralim/ue_tracker.git/git-receive-pack (100) authenticated
WARN  Internal error during receive-pack
java.lang.NullPointerException
        at java.util.AbstractCollection.addAll(AbstractCollection.java:303)
        at com.gitblit.GitServlet$GitblitReceiveHook.onPreReceive(GitServlet.java:275)
        at org.eclipse.jgit.transport.ReceivePack.service(ReceivePack.java:203)
        at org.eclipse.jgit.transport.ReceivePack.receive(ReceivePack.java:160)
        at org.eclipse.jgit.http.server.ReceivePackServlet.doPost(ReceivePackSer
vlet.java:187)


The output on the Client side shows:

Total 2 (delta 0), reused 0 (delta 0)
send-pack: protocol error: bad band #101
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

What version of the product are you using? On what operating system?
v.1.2.1

Please provide any additional information below.

Reported by rayjlim1 on 2013-06-11 18:14:32

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Reported by James.Moger on 2013-06-11 18:53:51

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

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Trying to help. :)
I see the lines 172-173
                scripts.addAll(GitBlit.self().getPreReceiveScriptsInherited(repository));
scripts.addAll(repository.preReceiveScripts);

in ReceiveHook.java
https://code.google.com/p/gitblit/source/browse/src/main/java/com/gitblit/git/ReceiveHook.java

Reported by rayjlim1 on 2013-06-11 19:35:06

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Yup.  That's it.  That collection is null after a fork because it's never set by the
fork method and the model from the fork is cached.  On a reload everything is just
dandy.

Reported by James.Moger on 2013-06-11 19:43:11

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Reported by James.Moger on 2013-06-11 20:02:05

  • Status changed: Queued

@gitblit
Copy link
Owner Author

@gitblit gitblit commented Aug 12, 2015

Fix or enhancement released in v1.3.0

Reported by James.Moger on 2013-07-14 16:52:58

  • Status changed: Fixed

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix added this to the 1.3.0 milestone Dec 13, 2016
@flaix flaix added this to the 1.3.0 milestone 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