summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
index 86e19f4c5d..77d2a3fc50 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
@@ -217,7 +217,10 @@ public class ObjectDirectory extends FileObjectDatabase {
* history of the repository.
*/
public Collection<PackFile> getPacks() {
- final PackFile[] packs = packList.get().packs;
+ PackList list = packList.get();
+ if (list == NO_PACKS)
+ list = scanPacks(list);
+ PackFile[] packs = list.packs;
return Collections.unmodifiableCollection(Arrays.asList(packs));
}