Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » NPE when using MergeCommand and StrategySimpleTwoWayInCore with conflicting commits
NPE when using MergeCommand and StrategySimpleTwoWayInCore with conflicting commits [message #1010710] Sun, 17 February 2013 23:38 Go to next message
Daniel Suskin is currently offline Daniel Suskin
Messages: 2
Registered: February 2013
Junior Member
Hi guys,

I'm working on using JGit in an application which will version image files. For merges, I'd like to simply write the "theirs" and "ours" versions of conflicting files to the filesystem so that the user can resolve the conflict.

To achieve this, I'm attempting to use a MergeCommand with its strategy set to MergeStrategy.SIMPLE_TWO_WAY_IN_CORE, since the strategy appears to treat any file differences as conflicts, and that is exactly what I want. However, when I execute a merge, I get a NullPointerException if there is a conflict:

java.lang.NullPointerException
at org.eclipse.jgit.merge.MergeMessageFormatter.formatWithConflicts(MergeMessageFormatter.java:141)
at org.eclipse.jgit.api.MergeCommand.call(MergeCommand.java:306)

I'm using JGit version 2.2.0.201212191850-r.

The immediate cause appears to be that some local variables in MergeCommand#call() are left as null unless the merge strategy is set to MergeStrategy.RESOLVE.

I checked around in the forums, jgit-dev list, and the Bugzilla, but I didn't notice anything related.

Am I using the merge strategy and MergeCommand class correctly? Should I be going about this in a different way?

Thanks for your help!
Re: NPE when using MergeCommand and StrategySimpleTwoWayInCore with conflicting commits [message #1016329 is a reply to message #1010710] Wed, 06 March 2013 00:04 Go to previous message
Daniel Suskin is currently offline Daniel Suskin
Messages: 2
Registered: February 2013
Junior Member
Bump. Any thoughts?
Previous Topic:Stash Apply
Next Topic:How to have files on index selected on commit dialog?
Goto Forum:
  


Current Time: Sun Aug 31 02:45:55 EDT 2014

Powered by FUDForum. Page generated in 0.08066 seconds