/// <summary> /// Return this iterator, or its parent, if the tree is at eof. /// </summary> /// <returns></returns> public CanonicalTreeParser next() { CanonicalTreeParser iterator = this; while (true) { iterator.next(1); if (iterator.eof() && iterator.Parent != null) { // Parent was left pointing at the entry for us; advance // the parent to the next entry, possibly unwinding many // levels up the tree. // iterator = (CanonicalTreeParser)iterator.Parent; continue; } return(iterator); } }
private void MarkTreeUninteresting(RevObject tree) { if ((tree.Flags & UNINTERESTING) != 0) return; tree.Flags |= UNINTERESTING; _treeWalk = _treeWalk.resetRoot(Repository, tree, WindowCursor); while (!_treeWalk.eof()) { FileMode mode = _treeWalk.EntryFileMode; var sType = (int)mode.ObjectType; 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(Repository, t, WindowCursor); continue; } break; default: if (FileMode.GitLink == FileMode.FromBits(mode.Bits)) break; _treeWalk.getEntryObjectId(IdBuffer); throw new CorruptObjectException("Invalid mode " + mode + " for " + IdBuffer + " " + _treeWalk.EntryPathString + " in " + tree + "."); } _treeWalk = _treeWalk.next(); } }