Преглед на файлове

Fix garbage collection failing to delete pack file

The loosen() method has opened pack file and the open pack file handle
may prevent it from being deleted e.g. on Windows. Fix this by closing
the pack file only after loosen() finished.

Bug: 574178
Change-Id: Icd59931a218d84c9c97b450eea87b21ed01248ff
Signed-off-by: andrew.xian2000@gmail.com
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
changes/18/182018/7
andrewxian2000 преди 2 години
родител
ревизия
1ae7e08bca
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java Целия файл

@@ -344,10 +344,10 @@ public class GC {
&& repo.getFS()
.lastModifiedInstant(oldPack.getPackFile())
.toEpochMilli() < packExpireDate) {
oldPack.close();
if (shouldLoosen) {
loosen(inserter, reader, oldPack, ids);
}
oldPack.close();
prunePack(oldPack.getPackFile());
}
}

Loading…
Отказ
Запис