summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinh Thai <mthai@google.com>2019-10-04 01:02:52 -0700
committerMinh Thai <mthai@google.com>2019-10-04 01:07:48 -0700
commit8dc0cca3082e249a312d9319bdc2bdbee3c80bec (patch)
tree464cff7292a55102681c2a880d65335043fce4b6
parent3b5a4416aaf69f9b5184e332c54ad2997c0b2fe9 (diff)
downloadjgit-8dc0cca3082e249a312d9319bdc2bdbee3c80bec.tar.gz
jgit-8dc0cca3082e249a312d9319bdc2bdbee3c80bec.zip
Fix NPE in DfsPackCompactor.compactReftables
Output pack description needs to be initialized. Change-Id: I4b66a18fa7020f528b312bc9f74b8d094ad6ad66 Signed-off-by: Minh Thai <mthai@google.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
index 724975bb2a..083124e5ed 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java
+++ b/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);