diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java index 5d3f9a935..0772278b1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsReader.java @@ -554,13 +554,16 @@ final class DfsReader extends ObjectReader implements ObjectReuseAsIs { List cached = new ArrayList(packList.length); for (DfsPackFile pack : packList) { DfsPackDescription desc = pack.getPackDescription(); - if (desc.getTips() == null || desc.getTips().isEmpty()) - continue; - cached.add(new DfsCachedPack(pack)); + if (canBeCachedPack(desc)) + cached.add(new DfsCachedPack(pack)); } return cached; } + private static boolean canBeCachedPack(DfsPackDescription desc) { + return desc.getTips() != null && !desc.getTips().isEmpty(); + } + public void copyPackAsIs(PackOutputStream out, CachedPack pack, boolean validate) throws IOException { try {