]> source.dussan.org Git - jgit.git/commit
PackWriter: make PackWriter.writeIndex() take a PackIndexWriter 74/1202274/22
authorSam Delmerico <delmerico@google.com>
Mon, 7 Oct 2024 21:34:03 +0000 (14:34 -0700)
committerSam Delmerico <delmerico@google.com>
Mon, 28 Oct 2024 20:54:42 +0000 (13:54 -0700)
commite5f42ae18e45e5c263ba510924e09cb2bb4bc822
tree39ea029d3bf2580be86be1970ab6c25c22e061c9
parent52405358a588b6453c7568e7430456826f2ce3b4
PackWriter: make PackWriter.writeIndex() take a PackIndexWriter

Previously, the PackWriter implementation required that indexes and
their extensions be writable to an OutputStream with a fixed binary
format.  To support more general index storage formats, allow
PackWriter to accept an PackIndexWriter interface which accepts only
the objects to store. This allows implementors to choose their storage
format.

The implementation will be provided by the DfsObjectDatabase. The
DfsObjectDatabase is already responsible for providing the OutputStream
that was previously used to write indexes. Having it provide a writing
interface would be a natural generalization.

This idea was previously implemented for PackBitmapIndex writing in
https://gerrithub.io/c/eclipse-jgit/jgit/+/1177722.

Change-Id: I582d2f3d25d6adb2da243d6d0d7bc405a97d6183
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriter.java