Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329611 - NullPointerException at org.eclipse.egit.core.op.CommitOperation.prepareTrees(CommitOperation.java:245)
Summary: NullPointerException at org.eclipse.egit.core.op.CommitOperation.prepareTrees...
Status: RESOLVED WORKSFORME
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.9.0   Edit
Hardware: Macintosh Mac OS X
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Jens Baumgart CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-06 07:38 EDT by Michael Vorburger CLA
Modified: 2011-04-14 22:52 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vorburger CLA 2010-11-06 07:38:30 EDT
On eGit 0.9.3 (which is not available in the Bugzilla Versions BTW), I got this NPE as I was trying to commit something:

eclipse.buildId=I20100608-0911
java.version=1.6.0_22
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/vorburger/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86 -product org.eclipse.epp.package.java.product -keyring /Users/vorburger/.eclipse_keyring -showlocation


Error
Sat Nov 06 12:34:07 CET 2010
An internal error occurred during: "Committing changes".

java.lang.NullPointerException
at org.eclipse.egit.core.op.CommitOperation.prepareTrees(CommitOperation.java:245)
at org.eclipse.egit.core.op.CommitOperation.access$7(CommitOperation.java:199)
at org.eclipse.egit.core.op.CommitOperation$1.run(CommitOperation.java:166)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.CommitOperation.execute(CommitOperation.java:192)
at org.eclipse.egit.ui.internal.actions.CommitActionHandler$1.run(CommitActionHandler.java:187)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0520 (org.eclipse.epp.package.java.product)
Comment 1 Jens Baumgart CLA 2010-11-08 12:15:16 EST
Can you reproduce this with a simple example?
If your sceanrio is more complex: can you attach your zipped repository?
Comment 2 Michael Vorburger CLA 2010-12-30 10:55:26 EST
I have not seen this anymore, and unfortunately can not offer any reproducible scenario; sorry. (May be just "harden" those lines with some if null? Else feel free to close as CANTREPRO.)
Comment 3 Hans Meier CLA 2011-01-05 16:46:32 EST
I also encountered this issue on Eclipse 3.6.1 with egit 0.10.1

!ENTRY org.eclipse.core.jobs 4 2 2011-01-05 22:44:17.693
!MESSAGE An internal error occurred during: "Committing changes".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.egit.core.op.CommitOperation.prepareTrees(CommitOperation.java:245)
	at org.eclipse.egit.core.op.CommitOperation.access$7(CommitOperation.java:199)
	at org.eclipse.egit.core.op.CommitOperation$1.run(CommitOperation.java:166)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
	at org.eclipse.egit.core.op.CommitOperation.execute(CommitOperation.java:192)
	at org.eclipse.egit.ui.internal.actions.CommitActionHandler$2.run(CommitActionHandler.java:206)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 4 Christian Halstrick CLA 2011-01-12 04:53:13 EST
We are currently replacing the related deprecated code. After we have done that we should retry.
Comment 5 Mat CLA 2011-02-23 12:44:28 EST
An internal error occurred during: "Committing changes".
java.lang.NullPointerException


That's all the 'Problem Occurred' dialog box tells me when I try to commit.

My project is a Latex project with the following structure:
out (not tracked)
src (tracked)
   png (tracked)
   document.tex (tracked
tmp (not tracked)


When I create a new project and attempt to make a commit it works just fine.

I have tried deleting my git repo and allowing Eclipse to recreate it, I've tried to untrack everything and then re-track it.

I've tried practically everything except recreating this project as a new one which I was hoping to avoid.
Comment 6 Gareth Clay CLA 2011-03-13 14:08:08 EDT
I'm seeing this issue too with EGit 0.11.3.

Same stack trace as Hans, just with a line number shift:

java.lang.NullPointerException
at org.eclipse.egit.core.op.CommitOperation.prepareTrees(CommitOperation.java:258)
at org.eclipse.egit.core.op.CommitOperation.access$7(CommitOperation.java:201)
at org.eclipse.egit.core.op.CommitOperation$1.run(CommitOperation.java:168)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
at org.eclipse.egit.core.op.CommitOperation.execute(CommitOperation.java:194)
at org.eclipse.egit.ui.internal.actions.CommitActionHandler$2.run(CommitActionHandler.java:208)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

My first few commits into an empty repository seemed to work, but now I've begun to throw a few new eclipse projects in there (on a new branch off), EGit seems unhappy.
Comment 7 Gareth Clay CLA 2011-03-13 14:27:36 EDT
I've just updated to 0.12.0.201103040937 via the nightlies update site, and the problem is gone :)

Keep up the great work guys!
Comment 8 Mathias Kinzler CLA 2011-03-18 11:07:38 EDT
(In reply to comment #7)
> I've just updated to 0.12.0.201103040937 via the nightlies update site, and the
> problem is gone :)
> 
> Keep up the great work guys!

Thanks for your patience. We have now completely replaced the code, so if something like that occurs again, just reopen this or create a new bug.
Comment 9 Mike Robinson CLA 2011-04-14 22:52:09 EDT
This bug should be kept open as it still occurs in the most-recent daily.  Against an existing project, I used "Team" to create a new GIT repository (which properly showed-up), then "Added" all of the files to it, then tried to "Commit."  The exception occurred repeatedly and the commit did not appear to succeed.

A command-line "git commit" appeared to complete the operation.