Package org.eclipse.jgit.errors

Examples of org.eclipse.jgit.errors.MissingObjectException


  public Tree getTree() throws IOException {
    if (treeObj == null) {
      treeObj = objdb.mapTree(getTreeId());
      if (treeObj == null) {
        throw new MissingObjectException(getTreeId(),
            Constants.TYPE_TREE);
      }
    }
    return treeObj;
  }
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

    if (checkReferencedIsReachable) {
      for (ObjectId id : baseObjects) {
           RevObject b = ow.lookupAny(id, Constants.OBJ_BLOB);
           if (!b.has(RevFlag.UNINTERESTING))
             throw new MissingObjectException(b, b.getType());
      }
    }

    RevCommit c;
    while ((c = ow.next()) != null) {
      if (checkReferencedIsReachable && !providedObjects.contains(c))
        throw new MissingObjectException(c, Constants.TYPE_COMMIT);
    }

    RevObject o;
    while ((o = ow.nextObject()) != null) {
      if (checkReferencedIsReachable) {
        if (providedObjects.contains(o))
          continue;
        else
          throw new MissingObjectException(o, o.getType());
      }

      if (o instanceof RevBlob && !db.hasObject(o))
        throw new MissingObjectException(o, Constants.TYPE_BLOB);
    }
  }
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
    final ObjectLoader ldr = db.openObject(this, objectId);
    if (ldr == null) {
      if (typeHint == OBJ_ANY)
        throw new MissingObjectException(objectId.copy(), "unknown");
      throw new MissingObjectException(objectId.copy(), typeHint);
    }
    if (typeHint != OBJ_ANY && ldr.getType() != typeHint)
      throw new IncorrectObjectTypeException(objectId.copy(), typeHint);
    return ldr;
  }
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
    long sz = db.getObjectSize(this, objectId);
    if (sz < 0) {
      if (typeHint == OBJ_ANY)
        throw new MissingObjectException(objectId.copy(), "unknown");
      throw new MissingObjectException(objectId.copy(), typeHint);
    }
    return sz;
  }
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

  @Override
  long findCRC32(AnyObjectId objId) throws MissingObjectException {
    final int levelOne = objId.getFirstByte();
    final int levelTwo = binarySearchLevelTwo(objId, levelOne);
    if (levelTwo == -1)
      throw new MissingObjectException(objId.copy(), "unknown");
    return NB.decodeUInt32(crc32[levelOne], levelTwo << 2);
  }
View Full Code Here

    }
    def.end();

    for (final DeltaChain base : missing) {
      if (base.head != null)
        throw new MissingObjectException(base, "delta base");
    }

    if (end - originalEOF < 20) {
      // Ugly corner case; if what we appended on to complete deltas
      // doesn't completely cover the SHA-1 we have to truncate off
View Full Code Here

    RevCommit c;
    while ((c = ow.next()) != null) {
      if (providedObjects != null //
          && !c.has(RevFlag.UNINTERESTING) //
          && !providedObjects.contains(c))
        throw new MissingObjectException(c, Constants.TYPE_COMMIT);
    }

    RevObject o;
    while ((o = ow.nextObject()) != null) {
      if (o.has(RevFlag.UNINTERESTING))
        continue;

      if (providedObjects != null) {
        if (providedObjects.contains(o))
          continue;
        else
          throw new MissingObjectException(o, o.getType());
      }

      if (o instanceof RevBlob && !db.hasObject(o))
        throw new MissingObjectException(o, Constants.TYPE_BLOB);
    }

    if (baseObjects != null) {
      for (ObjectId id : baseObjects) {
        o = ow.parseAny(id);
        if (!o.has(RevFlag.UNINTERESTING))
          throw new MissingObjectException(o, o.getType());
      }
    }
  }
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.