diff options
author | Shawn Pearce <sop@google.com> | 2014-11-25 16:14:33 -0800 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2014-11-27 13:41:58 -0800 |
commit | 3886a4f68b2a85526196c09332843676de9461cd (patch) | |
tree | 73bbaa969dae6680baaf2f9714e56c03c5d14f20 /org.eclipse.jgit | |
parent | a606dc363d0f6b09e4527cca6b645d3cb1ec407d (diff) | |
download | jgit-3886a4f68b2a85526196c09332843676de9461cd.tar.gz jgit-3886a4f68b2a85526196c09332843676de9461cd.zip |
ResolveMerger: Use checkoutEntry during abort
The cleanUp path is trying to restore files that previously were
clean, but were overwritten in the work tree by a partial merge
attempt that has failed and needs to be aborted. Reuse the checkout
logic to write the file content and refresh the stat data.
Change-Id: I320d33b3744daf88d3155db99e957408937ddd00
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java index dba89709aa..8e70f57fa3 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/ResolveMerger.java @@ -350,15 +350,8 @@ public class ResolveMerger extends ThreeWayMerger { while(mpathsIt.hasNext()) { String mpath=mpathsIt.next(); DirCacheEntry entry = dc.getEntry(mpath); - if (entry == null) - continue; - FileOutputStream fos = new FileOutputStream(new File( - db.getWorkTree(), mpath)); - try { - reader.open(entry.getObjectId()).copyTo(fos); - } finally { - fos.close(); - } + if (entry != null) + DirCacheCheckout.checkoutEntry(db, entry, reader); mpathsIt.remove(); } } |