summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Strapetz <marc.strapetz@syntevo.com>2019-05-22 23:51:12 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-05-27 10:49:51 +0200
commitf1577909e7f9c5cd886099ff774ffb83723cdbf0 (patch)
tree4b0ffb0d415cfbb5d9018d87247f27571ffbb06c
parent91101414ae1378cd6a0a6d2673e0e66f4a858828 (diff)
downloadjgit-f1577909e7f9c5cd886099ff774ffb83723cdbf0.tar.gz
jgit-f1577909e7f9c5cd886099ff774ffb83723cdbf0.zip
ObjectDirectory: fix closing of obsolete packs
This resolves a regression introduced in fef78212. Change-Id: Ibb4521635a87012520566efc70870c59d11be874 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java3
1 files changed, 2 insertions, 1 deletions
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 38e822ea7d..e35b9c9e4a 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;
}