Example #1
0
 private void advertise(StringBuilder m, char[] idtmp, RevObject o, string name)
 {
     o.add(ADVERTISED);
     m.Length = 0;
     o.getId().CopyTo(idtmp, m);
     m.Append(' ');
     m.Append(name);
 }
        private void ProcessTree(RevObject obj)
        {
            try
            {
                _treeWalk.reset(obj);
                while (_treeWalk.next())
                {
                    FileMode mode = _treeWalk.getFileMode(0);
                    int sType = mode.Bits;

                    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 + " for " + _idBuffer.Name + " " +
                                                             _treeWalk.getPathString() + " in " + obj.getId().Name + ".");
                    }
                }
            }
            catch (IOException ioe)
            {
                throw new TransportException("Cannot Read tree " + obj.Name, ioe);
            }
            obj.add(COMPLETE);
        }