aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2012-06-16 00:06:50 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2012-06-16 00:06:50 +0200
commitc745c93e40abdad7afde4e3b48dbb11469916112 (patch)
treefd92cf5a5a31bcf9d8757eaba8bf9e5089eaa747 /org.eclipse.jgit.test/tst/org/eclipse/jgit/storage
parentfe1f1b8f8aba60fdd1ad6f0f72e9c9180978cc60 (diff)
downloadjgit-c745c93e40abdad7afde4e3b48dbb11469916112.tar.gz
jgit-c745c93e40abdad7afde4e3b48dbb11469916112.zip
Fix LockFileTest on Windows
LockFileTest was failing on Windows because we couldn't delete the lock file of the index. The reason was that a LockFile instance still had an open handle to the lock file preventing us to delete the file (in contrast to the behavior on other platforms). Change-Id: I1d50442b7eb8a27f98f69ad77c5e24a9698a7b66 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/storage')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java
index 57770d3224..7c76f9de80 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/LockFileTest.java
@@ -70,13 +70,14 @@ public class LockFileTest extends RepositoryTestCase {
git.add().addFilepattern("file.txt").call();
assertNotNull(git.commit().setMessage("edit file").call());
- assertTrue(new LockFile(db.getIndexFile(), db.getFS()).lock());
+ LockFile lf = new LockFile(db.getIndexFile(), db.getFS());
+ assertTrue(lf.lock());
try {
git.checkout().setName(commit1.name()).call();
fail("JGitInternalException not thrown");
} catch (JGitInternalException e) {
assertTrue(e.getCause() instanceof LockFailedException);
- LockFile.unlock(((LockFailedException) e.getCause()).getFile());
+ lf.unlock();
git.checkout().setName(commit1.name()).call();
}
}