/** {@inheritDoc} */ @Override public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheIterator(this, currentSubtree); }
private CanonicalTreeParser createTreeIterator(RevTree tree) { CanonicalTreeParser treeParser = new CanonicalTreeParser(); ObjectReader objectReader = repo.getGit().getRepository().newObjectReader(); try { treeParser.reset(objectReader, tree.getId()); } catch (IncorrectObjectTypeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { objectReader.release(); } return treeParser; }
e.printStackTrace(); } catch (IncorrectObjectTypeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
private static ObjectLoader checkType(ObjectLoader ldr, AnyObjectId id, int typeHint) throws IncorrectObjectTypeException { if (typeHint != OBJ_ANY && ldr.getType() != typeHint) { throw new IncorrectObjectTypeException(id.copy(), typeHint); } return ldr; }
e.printStackTrace(); } catch (IncorrectObjectTypeException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
/** {@inheritDoc} */ @Override public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheBuildIterator(this, currentSubtree); }
/** * Locate a reference to an annotated tag and immediately parse its content. * <p> * Unlike {@link #lookupTag(AnyObjectId)} this method only returns * successfully if the tag object exists, is verified to be a tag, and was * parsed without error. * * @param id * name of the tag object. * @return reference to the tag object. Never null. * @throws org.eclipse.jgit.errors.MissingObjectException * the supplied tag does not exist. * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException * the supplied id is not a tag or an annotated tag. * @throws java.io.IOException * a pack file or loose object could not be read. */ @NonNull public RevTag parseTag(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = parseAny(id); if (!(c instanceof RevTag)) throw new IncorrectObjectTypeException(id.toObjectId(), Constants.TYPE_TAG); return (RevTag) c; }
/** {@inheritDoc} */ @Override public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader, final MutableObjectId idBuffer) throws IncorrectObjectTypeException, IOException { idBuffer.fromRaw(idBuffer(), idOffset()); if (!FileMode.TREE.equals(mode)) { final ObjectId me = idBuffer.toObjectId(); throw new IncorrectObjectTypeException(me, TYPE_TREE); } return createSubtreeIterator0(reader, idBuffer); }
/** * Locate a reference to a commit and immediately parse its content. * <p> * Unlike {@link #lookupCommit(AnyObjectId)} this method only returns * successfully if the commit object exists, is verified to be a commit, and * was parsed without error. * * @param id * name of the commit object. * @return reference to the commit object. Never null. * @throws org.eclipse.jgit.errors.MissingObjectException * the supplied commit does not exist. * @throws org.eclipse.jgit.errors.IncorrectObjectTypeException * the supplied id is not a commit or an annotated tag. * @throws java.io.IOException * a pack file or loose object could not be read. */ @NonNull public RevCommit parseCommit(AnyObjectId id) throws MissingObjectException, IncorrectObjectTypeException, IOException { RevObject c = peel(parseAny(id)); if (!(c instanceof RevCommit)) throw new IncorrectObjectTypeException(id.toObjectId(), Constants.TYPE_COMMIT); return (RevCommit) c; }
throw new IncorrectObjectTypeException(objectId.copy(), typeHint);
JGitText.get().cannotReadBackDelta, Integer.toString(type))); if (typeHint != OBJ_ANY && type != typeHint) { throw new IncorrectObjectTypeException(objectId.copy(), typeHint);
/** {@inheritDoc} */ @Override public ObjectLoader open(AnyObjectId objectId, int typeHint) throws MissingObjectException, IncorrectObjectTypeException, IOException { final ObjectLoader ldr = db.openObject(this, objectId); if (ldr == null) { if (typeHint == OBJ_ANY) throw new MissingObjectException(objectId.copy(), JGitText.get().unknownObjectType2); throw new MissingObjectException(objectId.copy(), typeHint); } if (typeHint != OBJ_ANY && ldr.getType() != typeHint) throw new IncorrectObjectTypeException(objectId.copy(), typeHint); return ldr; }
t = ((RevCommit) c).getTree(); else if (!(c instanceof RevTree)) throw new IncorrectObjectTypeException(id.toObjectId(), Constants.TYPE_TREE); else
throw new IncorrectObjectTypeException(obj, OBJ_BLOB); obj.flags = flags = obj.flags | SEEN; if ((flags & UNINTERESTING) == 0) throw new IncorrectObjectTypeException(obj, OBJ_TREE); obj.flags = flags = obj.flags | SEEN; if ((flags & UNINTERESTING) == 0)
rev = rw.peel(rev); if (!(rev instanceof RevBlob)) throw new IncorrectObjectTypeException(rev, Constants.TYPE_BLOB); } else if (item.equals("")) { //$NON-NLS-1$ rev = commit.getParent(0); } else throw new IncorrectObjectTypeException(rev, Constants.TYPE_COMMIT); rev = commit.getParent(0); } else throw new IncorrectObjectTypeException(rev, Constants.TYPE_COMMIT); throw new IncorrectObjectTypeException(rev, Constants.TYPE_COMMIT); int l;
private static ObjectLoader checkType(ObjectLoader ldr, AnyObjectId id, int typeHint) throws IncorrectObjectTypeException { if (typeHint != OBJ_ANY && ldr.getType() != typeHint) { throw new IncorrectObjectTypeException(id.copy(), typeHint); } return ldr; }
/** {@inheritDoc} */ @Override public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheIterator(this, currentSubtree); }
/** {@inheritDoc} */ @Override public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheBuildIterator(this, currentSubtree); }
@Override public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheBuildIterator(this, currentSubtree); }
@Override public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) throws IncorrectObjectTypeException, IOException { if (currentSubtree == null) throw new IncorrectObjectTypeException(getEntryObjectId(), Constants.TYPE_TREE); return new DirCacheIterator(this, currentSubtree); }