aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:22:09 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:22:09 +0200
commit29dce2e7beacabc3beb2d4ca7362df42a71e5a7a (patch)
tree9bd9c0d4fe0d479c69066868947a4e86862452e9 /org.eclipse.jgit.test
parent8984e1f663b5b58f74cd0381043133f0059e004d (diff)
parent9612aae885bd2247455163531e853576b4caebd6 (diff)
downloadjgit-29dce2e7beacabc3beb2d4ca7362df42a71e5a7a.tar.gz
jgit-29dce2e7beacabc3beb2d4ca7362df42a71e5a7a.zip
Merge branch 'stable-6.0' into stable-6.1
* stable-6.0: Remove stray files (probes or lock files) created by background threads Change-Id: Iab21b9776c2ebecd4cad5d015028cadd4b6541db
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
index 509935dfb9..7eab1dcb09 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/LockFileTest.java
@@ -200,4 +200,16 @@ public class LockFileTest extends RepositoryTestCase {
assertFalse(lock.isLocked());
checkFile(f, "contentother");
}
+
+ @Test
+ public void testUnlockNoop() throws Exception {
+ File f = writeTrashFile("somefile", "content");
+ try {
+ LockFile lock = new LockFile(f);
+ lock.unlock();
+ lock.unlock();
+ } catch (Throwable e) {
+ fail("unlock should be noop if not locked at all.");
+ }
+ }
}