Exemple #1
0
        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();
            }
        }
Exemple #2
0
        private void markTreeUninteresting(RevTree tree)
        {
            if ((tree.flags & UNINTERESTING) != 0)
                return;
            tree.flags |= UNINTERESTING;

            treeWalk = treeWalk.resetRoot(db, tree, curs);
            while (!treeWalk.eof())
            {
                FileMode mode = treeWalk.getEntryFileMode();
                int 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(db, t, curs);
                                continue;
                            }
                            break;
                        }
                    default:
                        if (FileMode.GitLink.Equals(mode.Bits))
                            break;
                        treeWalk.getEntryObjectId(idBuffer);
                        throw new CorruptObjectException("Invalid mode " + mode
                                + " for " + idBuffer.ToString() + " "
                                + treeWalk.getEntryPathString() + " in " + tree + ".");
                }

                treeWalk = treeWalk.next();
            }
        }