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
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();
}
}