Skip to content
Snippets Groups Projects
Commit 0b821817 authored by Shawn Pearce's avatar Shawn Pearce
Browse files

Add getPacks to ObjectDirectory


This exposes the list of known packs, allowing callers to list them
into a context like the objects/info/packs file.

Change-Id: I0b889564bd176836ff5c77ba310c6d229409dcd5
Signed-off-by: default avatarShawn O. Pearce <spearce@spearce.org>
parent e2c7bc8b
No related branches found
No related tags found
No related merge requests found
......@@ -147,6 +147,18 @@ private File fileFor(final String objectName) {
return new File(new File(objects, d), f);
}
/**
* @return unmodifiable collection of all known pack files local to this
* directory. Most recent packs are presented first. Packs most
* likely to contain more recent objects appear before packs
* containing objects referenced by commits further back in the
* history of the repository.
*/
public Collection<PackFile> getPacks() {
final PackFile[] packs = packList.get().packs;
return Collections.unmodifiableCollection(Arrays.asList(packs));
}
/**
* Add a single existing pack to the list of available pack files.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment