diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java index 29ef08483..2e0ed16a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java @@ -305,11 +305,9 @@ private boolean isExpired(Repository db) { private void unregisterAndCloseRepository(final Key location, Repository db) { synchronized (lockFor(location)) { - if (isExpired(db)) { - Repository oldDb = unregisterRepository(location); - if (oldDb != null) { - oldDb.close(); - } + Repository oldDb = unregisterRepository(location); + if (oldDb != null) { + oldDb.doClose(); } } }