Browse Source

Merge "Fixed FileTreeIteratorWithTimeControl"

stable-0.9
Christian Halstrick 15 years ago committed by Code Review
parent
commit
a9c0883ede
  1. 6
      org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorWithTimeControl.java

6
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();
}

Loading…
Cancel
Save