/// <exception cref="System.IO.IOException"></exception> private CanonicalTreeParser Enter(RevObject tree) { CanonicalTreeParser p = treeWalk.CreateSubtreeIterator0(reader, tree); if (p.Eof) { // We can't tolerate the subtree being an empty tree, as // that will break us out early before we visit all names. // If it is, advance to the parent's next record. // return(treeWalk.Next()); } return(p); }
/// <exception cref="NGit.Errors.MissingObjectException"></exception> /// <exception cref="NGit.Errors.IncorrectObjectTypeException"></exception> /// <exception cref="System.IO.IOException"></exception> private void MarkTreeUninteresting(RevTree tree) { if ((tree.flags & UNINTERESTING) != 0) { return; } tree.flags |= UNINTERESTING; treeWalk = treeWalk.ResetRoot(reader, tree); while (!treeWalk.Eof) { FileMode mode = treeWalk.EntryFileMode; int sType = mode.GetObjectType(); switch (sType) { case Constants.OBJ_BLOB: { treeWalk.GetEntryObjectId(idBuffer); LookupBlob(idBuffer).flags |= UNINTERESTING; break; } case Constants.OBJ_TREE: { treeWalk.GetEntryObjectId(idBuffer); RevTree t = LookupTree(idBuffer); if ((t.flags & UNINTERESTING) == 0) { t.flags |= UNINTERESTING; treeWalk = treeWalk.CreateSubtreeIterator0(reader, t); continue; } break; } default: { if (FileMode.GITLINK.Equals(mode)) { break; } treeWalk.GetEntryObjectId(idBuffer); throw new CorruptObjectException(MessageFormat.Format(JGitText.Get().corruptObjectInvalidMode3 , mode, idBuffer.Name, treeWalk.EntryPathString, tree)); } } treeWalk = treeWalk.Next(); } }