ソースを参照

Make ObjectDirectory getPacks() work the first time

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
Shawn O. Pearce 13年前
コミット
d00420ae6e
1個のファイルの変更4行の追加1行の削除
  1. 4
    1
      org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java

+ 4
- 1
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));
}


読み込み中…
キャンセル
保存