org.eclipse.jgit.errors.LargeObjectException Java Examples

The following examples show how to use org.eclipse.jgit.errors.LargeObjectException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectWalk.java    From onedev with MIT License 6 votes vote down vote up
private RevObject pushTree(RevObject obj) throws LargeObjectException,
		MissingObjectException, IncorrectObjectTypeException, IOException {
	TreeVisit tv = freeVisit;
	if (tv != null) {
		freeVisit = tv.parent;
		tv.ptr = 0;
		tv.namePtr = 0;
		tv.nameEnd = 0;
		tv.pathLen = 0;
	} else {
		tv = new TreeVisit();
	}
	tv.obj = obj;
	tv.buf = reader.open(obj, OBJ_TREE).getCachedBytes();
	tv.parent = currVisit;
	currVisit = tv;
	if (tv.parent == null) {
		tv.depth = 1;
	} else {
		tv.depth = tv.parent.depth + 1;
	}

	return obj;
}
 
Example #2
Source File: RevWalk.java    From onedev with MIT License 5 votes vote down vote up
private RevObject parseNew(AnyObjectId id, ObjectLoader ldr)
		throws LargeObjectException, CorruptObjectException,
		MissingObjectException, IOException {
	RevObject r;
	int type = ldr.getType();
	switch (type) {
	case Constants.OBJ_COMMIT: {
		final RevCommit c = createCommit(id);
		c.parseCanonical(this, getCachedBytes(c, ldr));
		r = c;
		break;
	}
	case Constants.OBJ_TREE: {
		r = new RevTree(id);
		r.flags |= PARSED;
		break;
	}
	case Constants.OBJ_BLOB: {
		r = new RevBlob(id);
		r.flags |= PARSED;
		break;
	}
	case Constants.OBJ_TAG: {
		final RevTag t = new RevTag(id);
		t.parseCanonical(this, getCachedBytes(t, ldr));
		r = t;
		break;
	}
	default:
		throw new IllegalArgumentException(MessageFormat.format(
				JGitText.get().badObjectType, Integer.valueOf(type)));
	}
	objects.add(r);
	return r;
}
 
Example #3
Source File: RevWalk.java    From onedev with MIT License 5 votes vote down vote up
byte[] getCachedBytes(RevObject obj, ObjectLoader ldr)
		throws LargeObjectException, MissingObjectException, IOException {
	try {
		return ldr.getCachedBytes(5 * MB);
	} catch (LargeObjectException tooBig) {
		tooBig.setObjectId(obj);
		throw tooBig;
	}
}
 
Example #4
Source File: ChangingIdentifiersRepositoryWalker.java    From naturalize with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void visitCommitFiles(final RevCommit commit) {
	try {
		System.out.println(commit);
		if (commit.getParentCount() > 0) {
			editListRetriever.retrieveEditListBetweenAndCallback(commit,
					commit.getParent(0), this);
		} else {
			doFirstScan(repositoryDir, commit.getName());
		}
	} catch (LargeObjectException | GitAPIException | IOException e) {
		LOGGER.warning(ExceptionUtils.getFullStackTrace(e));
	}

}
 
Example #5
Source File: RevWalk.java    From onedev with MIT License 4 votes vote down vote up
byte[] getCachedBytes(RevObject obj) throws LargeObjectException,
		MissingObjectException, IncorrectObjectTypeException, IOException {
	return getCachedBytes(obj, reader.open(obj, obj.getType()));
}
 
Example #6
Source File: AutoCRLFObjectLoader.java    From git-code-format-maven-plugin with MIT License 4 votes vote down vote up
@Override
public byte[] getCachedBytes() throws LargeObjectException {
  return convertBytes(delegate.getCachedBytes());
}
 
Example #7
Source File: AutoCRLFObjectLoader.java    From git-code-format-maven-plugin with MIT License 4 votes vote down vote up
@Override
public byte[] getCachedBytes(int sizeLimit)
    throws LargeObjectException, MissingObjectException, IOException {
  return convertBytes(delegate.getCachedBytes(sizeLimit));
}