Merge "Fixed FileTreeIteratorWithTimeControl"

This commit is contained in:
Christian Halstrick 2010-08-03 04:32:52 -04:00 committed by Code Review
commit a9c0883ede
1 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,7 @@
* 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 AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) {
@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();
}