Example #1
0
 /// <exception cref="NGit.Errors.TransportException"></exception>
 protected internal override void DoFetch(ProgressMonitor monitor, ICollection <Ref
                                                                                > want, ICollection <ObjectId> have)
 {
     VerifyPrerequisites();
     try
     {
         ObjectInserter ins = transport.local.NewObjectInserter();
         try
         {
             PackParser parser = ins.NewPackParser(bin);
             parser.SetAllowThin(true);
             parser.SetObjectChecking(transport.IsCheckFetchedObjects());
             parser.SetLockMessage(lockMessage);
             packLock = parser.Parse(NullProgressMonitor.INSTANCE);
             ins.Flush();
         }
         finally
         {
             ins.Release();
         }
     }
     catch (IOException err)
     {
         Close();
         throw new TransportException(transport.uri, err.Message, err);
     }
     catch (RuntimeException err)
     {
         Close();
         throw new TransportException(transport.uri, err.Message, err);
     }
 }
        /// <exception cref="System.IO.IOException"></exception>
        private void ReceivePack(ProgressMonitor monitor)
        {
            OnReceivePack();
            InputStream input = @in;

            if (sideband)
            {
                input = new SideBandInputStream(input, monitor, GetMessageWriter());
            }
            ObjectInserter ins = local.NewObjectInserter();

            try
            {
                PackParser parser = ins.NewPackParser(input);
                parser.SetAllowThin(thinPack);
                parser.SetObjectChecking(transport.IsCheckFetchedObjects());
                parser.SetLockMessage(lockMessage);
                packLock = parser.Parse(monitor);
                ins.Flush();
            }
            finally
            {
                ins.Release();
            }
        }
 /// <exception cref="System.IO.IOException"></exception>
 private PackParser Index(InputStream @in)
 {
     if (inserter == null)
     {
         inserter = db.NewObjectInserter();
     }
     return(inserter.NewPackParser(@in));
 }
Example #4
0
 /// <exception cref="System.IO.IOException"></exception>
 private PackParser Index(byte[] raw)
 {
     if (inserter == null)
     {
         inserter = repo.NewObjectInserter();
     }
     return(inserter.NewPackParser(new ByteArrayInputStream(raw)));
 }
        /// <exception cref="System.IO.IOException"></exception>
        private void OpenPack(TemporaryBuffer.Heap buf)
        {
            if (inserter == null)
            {
                inserter = src.NewObjectInserter();
            }
            byte[]     raw = buf.ToByteArray();
            PackParser p   = inserter.NewPackParser(new ByteArrayInputStream(raw));

            p.SetAllowThin(true);
            p.Parse(PM);
        }