Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Daussy2018-05-04 13:18:46 +0000
committerLaurent Goubet2018-06-04 15:00:29 +0000
commite5f2114530046be50ef7d85cd595dbd37fc58e42 (patch)
tree5e40aeedd50ab822f0b6e62ee7402e66fc23c3eb /plugins
parentf532d524682a7fb3c8c1b52483dd6ed52ca5708b (diff)
downloadorg.eclipse.emf.compare-e5f2114530046be50ef7d85cd595dbd37fc58e42.tar.gz
org.eclipse.emf.compare-e5f2114530046be50ef7d85cd595dbd37fc58e42.tar.xz
org.eclipse.emf.compare-e5f2114530046be50ef7d85cd595dbd37fc58e42.zip
[534365] Fix RecursiveModelMerger for "binary" git attributes
Properly sets up the TreeWalk in indexModelMergedFiles so it can access Git attributes. Bug: 534365 Change-Id: Ib4dd97c995bfa79d180f0a661a64a6ab5675e8ad
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
index 5c28d7dec..76017d522 100644
--- a/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
+++ b/plugins/org.eclipse.emf.compare.egit/src/org/eclipse/emf/compare/egit/internal/merge/RecursiveModelMerger.java
@@ -309,8 +309,13 @@ public class RecursiveModelMerger extends RecursiveMerger {
private void indexModelMergedFiles()
throws CorruptObjectException, MissingObjectException, IncorrectObjectTypeException, IOException {
try (TreeWalk syncingTreeWalk = new TreeWalk(getRepository())) {
- syncingTreeWalk.addTree(new DirCacheIterator(dircache));
- syncingTreeWalk.addTree(new FileTreeIterator(getRepository()));
+ int dirCacheIndex = syncingTreeWalk.addTree(new DirCacheIterator(dircache));
+
+ // Setting the DirCacheIterator is required to be able to handle properly Git attributes
+ FileTreeIterator aWorkingTreeIterator = new FileTreeIterator(getRepository());
+ syncingTreeWalk.addTree(aWorkingTreeIterator);
+ aWorkingTreeIterator.setDirCacheIterator(syncingTreeWalk, dirCacheIndex);
+
syncingTreeWalk.setRecursive(true);
syncingTreeWalk.setFilter(PathFilterGroup.createFromStrings(makeInSync));
String lastAdded = null;

Back to the top