Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » 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
Eclipse UserFriend
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
Eclipse UserFriend
Bump. Any thoughts?
Previous Topic:Stash Apply
Next Topic:How to have files on index selected on commit dialog?
Goto Forum:
  


Current Time: Tue Jul 08 12:01:41 EDT 2025

Powered by FUDForum. Page generated in 0.28055 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top