while (treeWalk.next()) {
DirCacheEntry entry = dci.getDirCacheEntry();
// Only add one edit per path
if (entry != null && entry.getStage() > DirCacheEntry.STAGE_1)
continue;
editor.add(new PathEdit(treeWalk.getPathString()) {
public void apply(DirCacheEntry ent) {
int stage = ent.getStage();
if (stage > DirCacheEntry.STAGE_0) {
if (checkoutStage != null) {
if (stage == checkoutStage.number)