If an object hasn't been accessed yet the pack list for a repository may not have been scanned from disk. If an application (e.g. the dumb transport servlet support code) asks for the pack list for an ObjectDirectory, we should load it immediately. Change-Id: I93d7b1bca422d905948e8e83b2afa83c8894a68b Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>tags/v0.10.1
@@ -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)); | |||
} | |||