Browse Source

Fix NPE in DfsPackCompactor.compactReftables

Output pack description needs to be initialized.

Change-Id: I4b66a18fa7020f528b312bc9f74b8d094ad6ad66
Signed-off-by: Minh Thai <mthai@google.com>
next
Minh Thai 5 years ago
parent
commit
8dc0cca308
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java

2
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java

@ -311,9 +311,9 @@ public class DfsPackCompactor {
DfsObjDatabase objdb = repo.getObjectDatabase();
Collections.sort(srcReftables, objdb.reftableComparator());
initOutDesc(objdb);
try (DfsReftableStack stack = DfsReftableStack.open(ctx, srcReftables);
DfsOutputStream out = objdb.writeFile(outDesc, REFTABLE)) {
initOutDesc(objdb);
ReftableCompactor compact = new ReftableCompactor(out);
compact.addAll(stack.readers());
compact.setIncludeDeletes(true);

Loading…
Cancel
Save