Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.MissingObjectException


        return cur.id;
      }

      public ObjectLoader open() throws IOException {
        if (cur.pack == null)
          throw new MissingObjectException(cur.id, "unknown");
        return cur.pack.load(DfsReader.this, cur.offset);
      }

      public boolean cancel(boolean mayInterruptIfRunning) {
        cancelReadAhead();
View Full Code Here


      public boolean next() throws MissingObjectException, IOException {
        if (idItr.hasNext()) {
          cur = idItr.next();
          if (cur.pack == null)
            throw new MissingObjectException(cur.id, "unknown");
          sz = cur.pack.getObjectSize(DfsReader.this, cur.offset);
          return true;
        } else if (findAllError != null) {
          throw findAllError;
        } else {
View Full Code Here

        return sz;
      }
    }

    if (typeHint == OBJ_ANY)
      throw new MissingObjectException(objectId.copy(), "unknown");
    throw new MissingObjectException(objectId.copy(), typeHint);
  }
View Full Code Here

      throws IOException, MissingObjectException {
    DfsPackFile[] packList = db.getPacks();
    if (packList.length == 0) {
      Iterator<ObjectToPack> itr = objects.iterator();
      if (itr.hasNext())
        throw new MissingObjectException(itr.next(), "unknown");
      return;
    }

    int objectCount = 0;
    int updated = 0;
    int posted = 0;
    List<DfsObjectRepresentation> all = new BlockList<DfsObjectRepresentation>();
    for (ObjectToPack otp : objects) {
      boolean found = false;
      for (int packIndex = 0; packIndex < packList.length; packIndex++) {
        DfsPackFile pack = packList[packIndex];
        long p = pack.findOffset(this, otp);
        if (0 < p) {
          DfsObjectRepresentation r = new DfsObjectRepresentation(otp);
          r.pack = pack;
          r.packIndex = packIndex;
          r.offset = p;
          all.add(r);
          found = true;
        }
      }
      if (!found)
        throw new MissingObjectException(otp, otp.getType());
      if ((++updated & 1) == 1) {
        monitor.update(1); // Update by 50%, the other 50% is below.
        posted++;
      }
      objectCount++;
View Full Code Here

        } catch (MissingObjectException mue) {
          if (!Constants.TYPE_COMMIT.equals(type)) {
            System.err.println(MessageFormat.format(CLIText.get().skippingObject, type, name));
            continue;
          }
          throw new MissingObjectException(id, type);
        }
        refs.put(name, new ObjectIdRef.Unpeeled(Ref.Storage.PACKED,
            name, id));
      }
    } finally {
View Full Code Here

    for (;;) {
      final RevObject o = nextObject();
      if (o == null)
        break;
      if (o instanceof RevBlob && !reader.has(o))
        throw new MissingObjectException(o, Constants.TYPE_BLOB);
    }
  }
View Full Code Here

  void parseHeaders(RevWalk walk) throws MissingObjectException,
      IncorrectObjectTypeException, IOException {
    if (walk.reader.has(this))
      flags |= PARSED;
    else
      throw new MissingObjectException(this, getType());
  }
View Full Code Here

  void parseHeaders(RevWalk walk) throws MissingObjectException,
      IncorrectObjectTypeException, IOException {
    if (walk.reader.has(this))
      flags |= PARSED;
    else
      throw new MissingObjectException(this, getType());
  }
View Full Code Here

      if (reader.has(obj, Constants.OBJ_BLOB))
        obj.add(COMPLETE);
      else
        throw new TransportException(MessageFormat.format(JGitText
            .get().cannotReadBlob, obj.name()),
            new MissingObjectException(obj, Constants.TYPE_BLOB));
    } catch (IOException error) {
      throw new TransportException(MessageFormat.format(
          JGitText.get().cannotReadBlob, obj.name()), error);
    }
  }
View Full Code Here

  private long findDeltaBase(ObjectId baseId) throws IOException,
      MissingObjectException {
    long ofs = idx().findOffset(baseId);
    if (ofs < 0)
      throw new MissingObjectException(baseId,
          JGitText.get().missingDeltaBase);
    return ofs;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.errors.MissingObjectException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.