diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2022-02-01 11:51:32 +0100 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2022-02-02 14:12:18 +0100 |
commit | 92158af52e3c438ecfef3cf3fab2126b1f77cd75 (patch) | |
tree | f0097c0469b05fd6d604df0a8bec62c8b18db13e | |
parent | a650ae8ad3f459f02f5e362baef49316deed80bb (diff) | |
download | jgit-92158af52e3c438ecfef3cf3fab2126b1f77cd75.tar.gz jgit-92158af52e3c438ecfef3cf3fab2126b1f77cd75.zip |
reftable: close old Db in FileRepository#convertToPackedRefs
This fixes test failures on Windows.
Change-Id: I701fbeb99ffd7951514ae6eae8b28cceb9aebd9f
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java index 53a1cd6390..3ebce6c409 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java @@ -665,18 +665,20 @@ public class FileRepository extends Repository { if (writeLogs) { List<ReflogEntry> logs = oldDb.getReflogReader(r.getName()) - .getReverseEntries(); + .getReverseEntries(); Collections.reverse(logs); for (ReflogEntry e : logs) { logWriter.log(r.getName(), e); } - } + } } try (RevWalk rw = new RevWalk(this)) { bru.execute(rw, NullProgressMonitor.INSTANCE); } + oldDb.close(); + List<String> failed = new ArrayList<>(); for (ReceiveCommand cmd : bru.getCommands()) { if (cmd.getResult() != ReceiveCommand.Result.OK) { |