Community
Participate
Working Groups
Build Identifier: eclipse.buildId=M20100909-0800 java.lang.NullPointerException at org.eclipse.jgit.lib.ObjectIdSubclassMap.index(ObjectIdSubclassMap.java:172) at org.eclipse.jgit.lib.ObjectIdSubclassMap.get(ObjectIdSubclassMap.java:89) at org.eclipse.jgit.revwalk.RevWalk.lookupCommit(RevWalk.java:629) at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:136) at org.eclipse.egit.core.op.MergeOperation$1.run(MergeOperation.java:102) 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.MergeOperation.execute(MergeOperation.java:122) at org.eclipse.egit.ui.internal.actions.MergeActionHandler$1.run(MergeActionHandler.java:66) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Reproducible: Always Steps to Reproduce: 1. Create a new project 2. Share project, create local git repository 3. Fetch from a remote repository, everything 4. Team | Merge... An internal error occurred during: "Merging with refs/remotes/origin/master".
What version of JGit are you using?
This is an EGit bug. EGit is passing in a null ObjectId. This part of JGit does not check for null arguments because we go through these routines so often that the null check is prohibitive. Look at why MergeOperation.java in EGit is supplying null to MergeCommand. It looks like one of the mergeCommand.include() invocations included something that has no current ObjectId (e.g. a branch that has not yet been created).
This was most probably caused by a non-existing HEAD in the local repository (a freshly created repository has no commit and no HEAD yet). This can't happen anymore since release 0.12 because "Team > Merge..." is disabled if there is no HEAD yet (fixed in egit commit 960dc3ff, included since release 0.12) . I tested that merge works properly if there was at least one commit in the local repository before merge is started.