From f1577909e7f9c5cd886099ff774ffb83723cdbf0 Mon Sep 17 00:00:00 2001 From: Marc Strapetz Date: Wed, 22 May 2019 23:51:12 +0200 Subject: [PATCH] ObjectDirectory: fix closing of obsolete packs This resolves a regression introduced in fef78212. Change-Id: Ibb4521635a87012520566efc70870c59d11be874 Signed-off-by: Marc Strapetz --- .../eclipse/jgit/internal/storage/file/ObjectDirectory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java index 38e822ea7..e35b9c9e4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java @@ -911,9 +911,10 @@ public class ObjectDirectory extends FileObjectDatabase { final String packName = base + PACK.getExtension(); final File packFile = new File(packDirectory, packName); - final PackFile oldPack = forReuse.remove(packName); + final PackFile oldPack = forReuse.get(packName); if (oldPack != null && !oldPack.getFileSnapshot().isModified(packFile)) { + forReuse.remove(packName); list.add(oldPack); continue; }