Fix NoSuchFileException in GC.deleteTempPacksIdx()
This exception is thrown in GC.deleteTempPacksIdx() if the repository has no packs. Bug: 538286 Change-Id: Ieb482be751226baf0843068a0f847e0cdc6e0cb6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
parent
8ab89ef066
commit
ddf56d6f85
|
@ -996,6 +996,9 @@ private void deleteOrphans() {
|
|||
private void deleteTempPacksIdx() {
|
||||
Path packDir = repo.getObjectDatabase().getPackDirectory().toPath();
|
||||
Instant threshold = Instant.now().minus(1, ChronoUnit.DAYS);
|
||||
if (!Files.exists(packDir)) {
|
||||
return;
|
||||
}
|
||||
try (DirectoryStream<Path> stream =
|
||||
Files.newDirectoryStream(packDir, "gc_*_tmp")) { //$NON-NLS-1$
|
||||
stream.forEach(t -> {
|
||||
|
|
Loading…
Reference in New Issue