aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorStefan Lay <stefan.lay@sap.com>2010-07-30 17:35:29 +0200
committerStefan Lay <stefan.lay@sap.com>2010-07-30 17:35:29 +0200
commitd9ceaa2f1e958abafc48b871ba0bd228fc1c7c0c (patch)
tree4f4edb483a2282f6ebdf271f3bf9eb3542060f65 /org.eclipse.jgit.test
parent94207f0a43a44261b8170d3cdba3028059775d9d (diff)
downloadjgit-d9ceaa2f1e958abafc48b871ba0bd228fc1c7c0c.tar.gz
jgit-d9ceaa2f1e958abafc48b871ba0bd228fc1c7c0c.zip
Fixed FileTreeIteratorWithTimeControl
getEntryLastModified returned wrong values for timestamps on boundaries. Change-Id: I0457ff030946fda7ecc70671bc65db02a8c206ee Signed-off-by: Stefan Lay <stefan.lay@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java
index fc19321c0a..bb76d0075d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java
@@ -65,7 +65,7 @@ import org.eclipse.jgit.util.FS;
* This class was written especially to test racy-git problems
*/
public class FileTreeIteratorWithTimeControl extends FileTreeIterator {
- private TreeSet<Long> modTimes = new TreeSet<Long>();
+ private TreeSet<Long> modTimes;
public FileTreeIteratorWithTimeControl(FileTreeIterator p, Repository repo,
TreeSet<Long> modTimes) {
@@ -99,7 +99,9 @@ public class FileTreeIteratorWithTimeControl extends FileTreeIterator {
@Override
public long getEntryLastModified() {
- Long cutOff = Long.valueOf(super.getEntryLastModified());
+ if (modTimes == null)
+ return 0;
+ Long cutOff = Long.valueOf(super.getEntryLastModified() + 1);
SortedSet<Long> head = modTimes.headSet(cutOff);
return head.isEmpty() ? 0 : head.last().longValue();
}