Community
Participate
Working Groups
Steps: 1) Create a new project using a new git repository (such as the auto-git-repo setting we're using on orion.eclipse.org) 2) Create a file in the project 3) Go to git status page. 4) Stage the change, and then unstage the change. -> NPE occurs: java.lang.NullPointerException at org.eclipse.jgit.lib.ObjectIdSubclassMap.index(ObjectIdSubclassMap.java:213) at org.eclipse.jgit.lib.ObjectIdSubclassMap.get(ObjectIdSubclassMap.java:89) at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:809) at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:724) at org.eclipse.jgit.api.ResetCommand.call(ResetCommand.java:149) at org.eclipse.orion.server.git.servlets.GitIndexHandlerV1.handlePost(GitIndexHandlerV1.java:130) at org.eclipse.orion.server.git.servlets.GitIndexHandlerV1.handleRequest(GitIndexHandlerV1.java:69) at org.eclipse.orion.server.git.servlets.GitIndexHandlerV1.handleRequest(GitIndexHandlerV1.java:1) at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:56) at org.eclipse.orion.server.git.servlets.GitHandlerV1.handleRequest(GitHandlerV1.java:1) at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:49) at org.eclipse.orion.server.git.servlets.ServletGitHandler.handleRequest(ServletGitHandler.java:1) at org.eclipse.orion.server.git.servlets.GitServlet.doGet(GitServlet.java:39) at org.eclipse.orion.server.git.servlets.GitServlet.doPost(GitServlet.java:58)
I have entered bug 339610 against JGit. As a workaround, Tomasz suggested we do an initial commit for free when creating the repository: File root = new File(new File(location), Constants.DOT_GIT); FileRepository repo = new FileRepository(root); repo.create(); Git git = new Git(repo); git.add().addFilepattern(".").call(); git.commit().setMessage("Initial commit").call();
Simon and I discussed this yesterday and decided to go ahead with the workaround. I'm leaving this open so we can remove this when the JGit bug is fixed.
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see: https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html