From 243e14d051852cc38cff773571e42d42cadfe50e Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Sat, 6 Oct 2012 12:56:00 +0200 Subject: [PATCH] Add a check in fstick that the reference file exists This helps avoiding some stupid thinkos. Change-Id: I5b386cd9c6bf0e11f270bb2b8cfaac66ce9b341b --- .../tst/org/eclipse/jgit/lib/RepositoryTestCase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java index 60b9462a0..60408054b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java @@ -371,6 +371,8 @@ public static String lookup(Object l, String nameTemplate, public static long fsTick(File lastFile) throws InterruptedException, IOException { long sleepTime = 1; + if (lastFile != null && !lastFile.exists()) + throw new FileNotFoundException(lastFile.getPath()); File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); try { long startTime = (lastFile == null) ? tmp.lastModified() : lastFile