aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:20:28 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2022-05-27 16:20:28 +0200
commit9612aae885bd2247455163531e853576b4caebd6 (patch)
tree8870d405f13c217bcf9145bf68104b9a533a278e /org.eclipse.jgit.test
parentcec6db62af51a43e4c121f135a98de443ef0cd2c (diff)
parentd67ac798f10254d038c49244e7f1e2323afdfdfc (diff)
downloadjgit-9612aae885bd2247455163531e853576b4caebd6.tar.gz
jgit-9612aae885bd2247455163531e853576b4caebd6.zip
Merge branch 'stable-5.13' into stable-6.0
* stable-5.13: Remove stray files (probes or lock files) created by background threads Change-Id: I7af1355a77f14995118145162f6bb8a4f1755f2b
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.");
+ }
+ }
}