private boolean reuseDeltaFor(ObjectToPack otp) { int type = otp.getType(); if ((type & 2) != 0) // OBJ_TREE(2) or OBJ_BLOB(3) return true; if (type == OBJ_COMMIT) return reuseDeltaCommits; if (type == OBJ_TAG) return false; return true; }
/** @return type of the object in this window entry. */ final int type() { return object.getType(); }
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
private void writeWholeObjectDeflate(PackOutputStream out, final ObjectToPack otp) throws IOException { final Deflater deflater = deflater(); final ObjectLoader ldr = reader.open(otp, otp.getType()); crc32.reset(); otp.setOffset(out.length()); out.writeHeader(otp, ldr.getSize()); deflater.reset(); DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater); ldr.copyTo(dst); dst.finish(); }
StringBuilder buf = new StringBuilder(); buf.append("ObjectToPack["); buf.append(Constants.typeString(getType())); buf.append(" "); buf.append(name());
@Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
tags = new EWAHCompressedBitmap(sizeInWords); for (int i = 0; i < objects.size(); i++) { int type = objects.get(i).getType(); switch (type) { case Constants.OBJ_COMMIT:
private boolean reuseDeltaFor(ObjectToPack otp) { int type = otp.getType(); if ((type & 2) != 0) // OBJ_TREE(2) or OBJ_BLOB(3) return true; if (type == OBJ_COMMIT) return reuseDeltaCommits; if (type == OBJ_TAG) return false; return true; }
/** @return type of the object in this window entry. */ final int type() { return object.getType(); }
private boolean reuseDeltaFor(ObjectToPack otp) { int type = otp.getType(); if ((type & 2) != 0) // OBJ_TREE(2) or OBJ_BLOB(3) return true; if (type == OBJ_COMMIT) return reuseDeltaCommits; if (type == OBJ_TAG) return false; return true; }
/** @return type of the object in this window entry. */ final int type() { return object.getType(); }
write(headerBuffer, 0, n + 20); } else { int n = objectHeader(rawLength, otp.getType(), headerBuffer); write(headerBuffer, 0, n);
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
private void writeObjects(PackOutputStream out, List<ObjectToPack> list) throws IOException { if (list.isEmpty()) return; typeStats = stats.objectTypes[list.get(0).getType()]; long beginOffset = out.length(); if (reuseSupport != null) { reuseSupport.writeObjects(out, list); } else { for (ObjectToPack otp : list) out.writeObject(otp); } typeStats.bytes += out.length() - beginOffset; typeStats.cntObjects = list.size(); }
private void writeWholeObjectDeflate(PackOutputStream out, final ObjectToPack otp) throws IOException { final Deflater deflater = deflater(); final ObjectLoader ldr = reader.open(otp, otp.getType()); crc32.reset(); otp.setOffset(out.length()); out.writeHeader(otp, ldr.getSize()); deflater.reset(); DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater); ldr.copyTo(dst); dst.finish(); }
private void writeWholeObjectDeflate(PackOutputStream out, final ObjectToPack otp) throws IOException { final Deflater deflater = deflater(); final ObjectLoader ldr = reader.open(otp, otp.getType()); crc32.reset(); otp.setOffset(out.length()); out.writeHeader(otp, ldr.getSize()); deflater.reset(); DeflaterOutputStream dst = new DeflaterOutputStream(out, deflater); ldr.copyTo(dst); dst.finish(); }
StringBuilder buf = new StringBuilder(); buf.append("ObjectToPack["); buf.append(Constants.typeString(getType())); buf.append(" "); buf.append(name());
public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
@Override public int compare(ObjectToPack a, ObjectToPack b) { int cmp = (a.isDoNotDelta() ? 1 : 0) - (b.isDoNotDelta() ? 1 : 0); if (cmp != 0) return cmp; cmp = a.getType() - b.getType(); if (cmp != 0) return cmp; cmp = (a.getPathHash() >>> 1) - (b.getPathHash() >>> 1); if (cmp != 0) return cmp; cmp = (a.getPathHash() & 1) - (b.getPathHash() & 1); if (cmp != 0) return cmp; cmp = (a.isEdge() ? 0 : 1) - (b.isEdge() ? 0 : 1); if (cmp != 0) return cmp; return b.getWeight() - a.getWeight(); } });
write(headerBuffer, 0, n + 20); } else { int n = objectHeader(rawLength, otp.getType(), headerBuffer); write(headerBuffer, 0, n);