switch (getOptions().getAutoCRLF()) {
case INPUT:
case TRUE:
InputStream dcIn = null;
try {
ObjectLoader loader = reader.open(entry.getObjectId());
if (loader == null)
return true;
// We need to compute the length, but only if it is not
// a binary stream.
dcIn = new EolCanonicalizingInputStream(
loader.openStream(), true, true /* abort if binary */);
long dcInLen;
try {
dcInLen = computeLength(dcIn);
} catch (EolCanonicalizingInputStream.IsBinaryException e) {
return true;
} finally {
dcIn.close();
}
dcIn = new EolCanonicalizingInputStream(
loader.openStream(), true);
byte[] autoCrLfHash = computeHash(dcIn, dcInLen);
boolean changed = getEntryObjectId().compareTo(
autoCrLfHash, 0) != 0;
return changed;
} catch (IOException e) {