From 8dc68a796f95892e7caead640f61460b2281582d Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 13 Jun 2018 21:35:40 +0200 Subject: Fix merge of wrong patchset of "EGit integration for LFS" By rebasing an outdated version I submitted patchset 8 [1] instead of patchset 7 [2] of the change "EGit integration for LFS". This is the reverse delta between these two patchsets. [1] https://git.eclipse.org/r/#/c/124333/8 [2] https://git.eclipse.org/r/#/c/124333/7 Change-Id: Id513120ea153a14991c3925cd676f5738aa49167 Signed-off-by: Matthias Sohn --- .../org/eclipse/egit/ui/internal/CompareUtils.java | 23 +++++++--------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java index d45732baea..56cdd065b5 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java @@ -68,7 +68,6 @@ import org.eclipse.egit.ui.internal.synchronize.compare.LocalNonWorkspaceTypedEl import org.eclipse.jface.action.Action; import org.eclipse.jface.util.OpenStrategy; import org.eclipse.jgit.annotations.NonNull; -import org.eclipse.jgit.attributes.Attributes; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheCheckout.CheckoutMetadata; import org.eclipse.jgit.dircache.DirCacheEditor; @@ -93,8 +92,6 @@ import org.eclipse.jgit.treewalk.filter.NotIgnoredFilter; import org.eclipse.jgit.treewalk.filter.PathFilterGroup; import org.eclipse.jgit.treewalk.filter.TreeFilter; import org.eclipse.jgit.util.IO; -import org.eclipse.jgit.util.LfsFactory; -import org.eclipse.jgit.util.LfsFactory.LfsInputStream; import org.eclipse.jgit.util.io.EolStreamTypeUtil; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; @@ -1105,21 +1102,15 @@ public class CompareUtils { if (ent.getFileMode() != FileMode.REGULAR_FILE) ent.setFileMode(FileMode.REGULAR_FILE); + ent.setLength(content.limit()); ent.setLastModified(System.currentTimeMillis()); try { - Attributes attr = LfsFactory.getAttributesForPath(repo, - ent.getPathString()); - try (LfsInputStream lfs = LfsFactory.getInstance() - .applyCleanFilter(repo, - new ByteArrayInputStream(content.array(), 0, - content.limit()), - content.limit(), - attr.get(Constants.ATTR_MERGE))) { - ent.setLength(lfs.getLength()); - ent.setObjectId(inserter.insert(Constants.OBJ_BLOB, - lfs.getLength(), lfs)); - inserter.flush(); - } + ByteArrayInputStream in = new ByteArrayInputStream( + content.array(), 0, content.limit()); + ent.setObjectId( + inserter.insert(Constants.OBJ_BLOB, content.limit(), + in)); + inserter.flush(); } catch (IOException ex) { throw new RuntimeException(ex); } -- cgit v1.2.3