Don't swallow IOException in GC.PidLock#lock
This broke the test GcConcurrentTest#testInterruptGc which expects
ClosedByInterruptException when the thread doing gc is interrupted.
Change-Id: I89e02fc37aceeccb04c20cfc5b71cb8fa21793d6
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index 04c8418..7feb506 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -1631,7 +1631,7 @@ private class PidLock implements AutoCloseable {
pidFile = repo.getDirectory().toPath().resolve(GC_PID);
}
- boolean lock() {
+ boolean lock() throws IOException {
if (Files.exists(pidFile)) {
Instant mtime = FS.DETECTED
.lastModifiedInstant(pidFile.toFile());
@@ -1670,7 +1670,7 @@ boolean lock() {
JGitText.get().closePidLockFailed, pidFile),
e1);
}
- return false;
+ throw e;
}
return true;
}