|Behavior divergence between Git and JGit on binary merge [message #1764548]
||Wed, 31 May 2017 07:47
| Mathieu Cartaud
Registered: April 2016
Hello JGit committers,|
I was doing some tests with the merge of conflicting binary files and ran into a divergence of behavior between Git and JGit. I would like to know if this is something wanted or an issue.
In Git (version 2.11.0 packaged with Xcode on a Mac), when I merge try to merge two different version of an image (png), I stop on a conflit and before doing anything else, I am still able to open the file in an Eclipse editor. The result displayed is the local version of the image (before the conflict).
With JGit on the other hand, the image is corrupted until I use the merge tool to choose a version or the other.
I think the issue comes from the fact that JGit handle binary files like textual ones : it try to merge the file and then write the conflicting result to let the user choose what to do (ResolveMerger.updateIndex).
When trying to merge the file, JGit add conflicts metadata in the file even if it is a binary one (MergeFormatterPass.writeConflictMetadata). This result to a corrupted file containing conflicting binary parts.
Is this a known or wanted behavior?
- import the given project into Eclipse
- checkout the branch smiling and merge with the branch sad using JGit.
- verify that if you double click on the file smiley.png, the editor cannot open it.
- reset the branch smiling
- use Git to merge with the branch sad
- double click on the file smiley.png in Eclipse and verify that the editor can open it
(Size: 84.57KB, Downloaded 64 times)
[Updated on: Wed, 31 May 2017 12:50]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01690 seconds