summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2014-11-25 16:14:33 -0800
committerShawn Pearce <spearce@spearce.org>2014-11-27 13:41:58 -0800
commit3886a4f68b2a85526196c09332843676de9461cd (patch)
tree73bbaa969dae6680baaf2f9714e56c03c5d14f20 /org.eclipse.jgit
parenta606dc363d0f6b09e4527cca6b645d3cb1ec407d (diff)
downloadjgit-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.java11
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();
}
}