diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java index e19bfc4fb..e8a125d57 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectLoader.java @@ -166,6 +166,7 @@ public abstract class ObjectLoader { if (isLarge()) { ObjectStream in = openStream(); try { + final long sz = in.getSize(); byte[] tmp = new byte[1024]; long copied = 0; for (;;) { @@ -175,7 +176,7 @@ public abstract class ObjectLoader { out.write(tmp, 0, n); copied += n; } - if (copied != getSize()) + if (copied != sz) throw new EOFException(); } finally { in.close();