NPE when using MergeCommand and StrategySimpleTwoWayInCore with conflicting commits [message #1010710] |
Mon, 18 February 2013 04:38 |
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!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02667 seconds