entries.remove(stashRefEntry);
ObjectId entryId = ObjectId.zeroId();
try {
for (int i = entries.size() - 1; i >= 0; i--) {
ReflogEntry entry = entries.get(i);
writer.log(stashLockRef, entryId, entry.getNewId(),
entry.getWho(), entry.getComment());
entryId = entry.getNewId();
}
if (!stashLockFile.renameTo(stashFile)) {
FileUtils.delete(stashFile);
if (!stashLockFile.renameTo(stashFile))
throw new JGitInternalException(MessageFormat.format(