Community
Participate
Working Groups
What steps will reproduce the problem? 1. Add a new source file to a java project 2. Add it to the git repo with Team>Add 3. Remove the added resource from the file system (outside of eclipse) (optinally refresh project) 4. Use Team>Reset with the Hard option 5. NPE If you instead add the file to the repository root, you will end up with an index that still contains the extra entry after reset. Running code coverage on Jgit reveals that we have a number of code paths in DirCacheCheckout that are not covered by any test. According to Murphy's law untested code does not work. -- Error Details -- Date: Sun May 29 11:36:47 CEST 2011 Message: An internal error occurred during: "Resetting to refs/heads/master". Severity: Error Product: Eclipse SDK 3.6.2.v201102101200 (org.eclipse.sdk.ide) Plugin: org.eclipse.core.jobs Session Data: eclipse.buildId=M20110210-1200 java.version=1.6.0_25 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=sv_SE Framework arguments: -product org.eclipse.sdk.ide Command-line arguments: -product org.eclipse.sdk.ide -data /Users/me/SW/myegit -dev file:/Users/me/SW/egitcontrib/.metadata/.plugins/org.eclipse.pde.core/New_configuration (1)/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog Exception Stack Trace: java.lang.NullPointerException at org.eclipse.jgit.dircache.DirCacheCheckout.processEntry(DirCacheCheckout.java:358) at org.eclipse.jgit.dircache.DirCacheCheckout.prescanOneTree(DirCacheCheckout.java:282) at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:382) at org.eclipse.egit.core.op.ResetOperation.checkoutIndex(ResetOperation.java:250) at org.eclipse.egit.core.op.ResetOperation.reset(ResetOperation.java:138) at org.eclipse.egit.core.op.ResetOperation.access$0(ResetOperation.java:115) at org.eclipse.egit.core.op.ResetOperation$1.run(ResetOperation.java:105) 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.ResetOperation.execute(ResetOperation.java:109) at org.eclipse.egit.ui.internal.job.JobUtil$1.run(JobUtil.java:50) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Robin, tried hard to reproduce this on windows and linux. I even switched with jgit/egit to commits d203485/7bf4841 (which where in master 29.05.2011). But I can't reproduce this. Can you still reproduce this?
(In reply to comment #1) > Robin, tried hard to reproduce this on windows and linux. I even switched with > jgit/egit to commits d203485/7bf4841 (which where in master 29.05.2011). But I > can't reproduce this. Can you still reproduce this? I still get an NPE, but not in the same location, strangely I'm not java.lang.NullPointerException at org.eclipse.egit.core.ContainerTreeIterator.<init>(ContainerTreeIterator.java:124) at org.eclipse.egit.core.ContainerTreeIterator.createSubtreeIterator(ContainerTreeIterator.java:132) at org.eclipse.jgit.treewalk.AbstractTreeIterator.createSubtreeIterator(AbstractTreeIterator.java:527) at org.eclipse.jgit.treewalk.TreeWalk.enterSubtree(TreeWalk.java:907) at org.eclipse.jgit.treewalk.TreeWalk.next(TreeWalk.java:566) at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:281) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiff(IndexDiffCacheEntry.java:263) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$2(IndexDiffCacheEntry.java:254) at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$3.run(IndexDiffCacheEntry.java:149) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
See http://egit.eclipse.org/r/#change,4357 for JUnit Demo
*** Bug 350880 has been marked as a duplicate of this bug. ***
Patch posted: http://egit.eclipse.org/r/#change,4358
merged as 2e43dcd6454d49d733d114a6c40ced05a3e93b8d
Verified in 1.2.0.201110190928.