diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java index e9eb366f6..2a5caf854 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackWriter.java @@ -977,14 +977,17 @@ public class PackWriter { } private void writeObjects(PackOutputStream out) throws IOException { + for (List list : objectsLists) + writeObjects(out, list); + } + + private void writeObjects(PackOutputStream out, List list) + throws IOException { if (reuseSupport != null) { - for (List list : objectsLists) - reuseSupport.writeObjects(out, list); + reuseSupport.writeObjects(out, list); } else { - for (List list : objectsLists) { - for (ObjectToPack otp : list) - out.writeObject(otp); - } + for (ObjectToPack otp : list) + out.writeObject(otp); } }