From 8dc0cca3082e249a312d9319bdc2bdbee3c80bec Mon Sep 17 00:00:00 2001 From: Minh Thai Date: Fri, 4 Oct 2019 01:02:52 -0700 Subject: [PATCH] Fix NPE in DfsPackCompactor.compactReftables Output pack description needs to be initialized. Change-Id: I4b66a18fa7020f528b312bc9f74b8d094ad6ad66 Signed-off-by: Minh Thai --- .../org/eclipse/jgit/internal/storage/dfs/DfsPackCompactor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 724975bb2..083124e5e 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);