private void ProcessTree(RevObject obj)
        {
            try
            {
                _treeWalk.reset(obj);
                while (_treeWalk.next())
                {
                    FileMode mode  = _treeWalk.getFileMode(0);
                    int      sType = (int)mode.ObjectType;

                    switch (sType)
                    {
                    case Constants.OBJ_BLOB:
                    case Constants.OBJ_TREE:
                        _treeWalk.getObjectId(_idBuffer, 0);
                        Needs(_revWalk.lookupAny(_idBuffer, sType));
                        continue;

                    default:
                        if (FileMode.GitLink.Equals(sType))
                        {
                            continue;
                        }
                        _treeWalk.getObjectId(_idBuffer, 0);
                        throw new CorruptObjectException("Invalid mode " + mode.ObjectType + " for " + _idBuffer.Name + " " +
                                                         _treeWalk.getPathString() + " in " + obj.getId().Name + ".");
                    }
                }
            }
            catch (IOException ioe)
            {
                throw new TransportException("Cannot Read tree " + obj.Name, ioe);
            }
            obj.add(COMPLETE);
        }
Example #2
0
        private static DirCacheEntry ToEntry(int stage, TreeWalk.TreeWalk tw)
        {
            var e        = new DirCacheEntry(tw.getRawPath(), stage);
            var iterator = tw.getTree <AbstractTreeIterator>(0, typeof(AbstractTreeIterator));

            e.setFileMode(tw.getFileMode(0));
            e.setObjectIdFromRaw(iterator.idBuffer(), iterator.idOffset());
            return(e);
        }