Browse Source

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>
stable-5.1
Marc Strapetz 6 years ago committed by Matthias Sohn
parent
commit
f1577909e7
  1. 3
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java

3
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 String packName = base + PACK.getExtension();
final File packFile = new File(packDirectory, packName); final File packFile = new File(packDirectory, packName);
final PackFile oldPack = forReuse.remove(packName); final PackFile oldPack = forReuse.get(packName);
if (oldPack != null if (oldPack != null
&& !oldPack.getFileSnapshot().isModified(packFile)) { && !oldPack.getFileSnapshot().isModified(packFile)) {
forReuse.remove(packName);
list.add(oldPack); list.add(oldPack);
continue; continue;
} }

Loading…
Cancel
Save