entry.setFileMode(stashIndexIter.getEntryFileMode());
entry.setObjectId(stashIndexIter.getEntryObjectId());
DirCacheCheckout.checkoutEntry(repo, file, entry,
treeWalk.getObjectReader());
final DirCacheEntry updatedEntry = entry;
editor.add(new PathEdit(path) {
public void apply(DirCacheEntry ent) {
ent.copyMetaData(updatedEntry);
}
});