/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know its id, see * {@link org.eclipse.jgit.lib.Constants#EMPTY_BLOB_ID}. If an entry has * length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
byte[] autoCrLfHash = computeHash(dcIn, dcInLen); boolean changed = getEntryObjectId() .compareTo(autoCrLfHash, 0) != 0; return changed;
if (ObjectId.zeroId().compareTo(raw, ptr - OBJECT_ID_LENGTH) == 0) { report(NULL_SHA1, id, JGitText.get().corruptObjectZeroId);
/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know his id see {@link Constants#EMPTY_BLOB_ID}. If an entry * has length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
/** * Check whether this entry has been smudged or not * <p> * If a blob has length 0 we know its id, see * {@link org.eclipse.jgit.lib.Constants#EMPTY_BLOB_ID}. If an entry has * length 0 and an ID different from the one for empty blob we know this * entry was smudged. * * @return <code>true</code> if the entry is smudged, <code>false</code> * otherwise */ public final boolean isSmudged() { final int base = infoOffset + P_OBJECTID; return (getLength() == 0) && (Constants.EMPTY_BLOB_ID.compareTo(info, base) != 0); }
@SuppressWarnings("boxing") private boolean isValid() { Boolean v = valid; if (v == null) { MessageDigest m = newMessageDigest(); m.update(dataBuf, dataPtr, dataLen); v = key.getChunkHash().compareTo(m.digest(), 0) == 0; valid = v; } return v.booleanValue(); }
@SuppressWarnings("boxing") private boolean isValid() { Boolean v = valid; if (v == null) { MessageDigest m = newMessageDigest(); m.update(dataBuf, dataPtr, dataLen); v = key.getChunkHash().compareTo(m.digest(), 0) == 0; valid = v; } return v.booleanValue(); }
protected List<String> getTagsOnHead() throws IOException { final ObjectId head = repository.resolve(Constants.HEAD); logger.info("Head is {}", head.toString()); return repository.getTags().entrySet().stream() .filter(entry -> { final Boolean value = entry.getValue().getPeeledObjectId() != null && entry.getValue().getPeeledObjectId().compareTo(head) == 0; logger.debug("Comparing {} to {} : result {}", entry.getValue().getPeeledObjectId(), head, value); return value; }) .map(Map.Entry::getKey) .collect(Collectors.toList()); }
byte[] autoCrLfHash = computeHash(dcIn, dcInLen); boolean changed = getEntryObjectId() .compareTo(autoCrLfHash, 0) != 0; return changed;
byte[] autoCrLfHash = computeHash(dcIn, dcInLen); boolean changed = getEntryObjectId() .compareTo(autoCrLfHash, 0) != 0; return changed;
if (ObjectId.zeroId().compareTo(raw, ptr - OBJECT_ID_LENGTH) == 0) { report(NULL_SHA1, id, JGitText.get().corruptObjectZeroId);
JGitText.get().corruptObjectTruncatedInObjectId); if (ObjectId.zeroId().compareTo(raw, ptr - OBJECT_ID_LENGTH) == 0) { report(NULL_SHA1, id, JGitText.get().corruptObjectZeroId);