private void CheckoutOutIndexNoHead()
{
var visitor = new AbstractIndexTreeVisitor
{
VisitEntry = (m, i, f) =>
{
if (m == null)
{
_index.remove(_root, f);
return;
}
bool needsCheckout = false;
if (i == null)
{
needsCheckout = true;
}
else if (i.ObjectId.Equals(m.Id))
{
if (i.IsModified(_root, true))
{
needsCheckout = true;
}
}
else
{
needsCheckout = true;
}
if (needsCheckout)
{
GitIndex.Entry newEntry = _index.addEntry(m);
_index.checkoutEntry(_root, newEntry);
}
}
};
new IndexTreeWalker(_index, _merge, _root, visitor).Walk();
}