|
|
@ -82,7 +82,7 @@ public class RacyGitTests extends RepositoryTestCase { |
|
|
|
} |
|
|
|
} |
|
|
|
FileTreeIteratorWithTimeControl fileIt = new FileTreeIteratorWithTimeControl( |
|
|
|
FileTreeIteratorWithTimeControl fileIt = new FileTreeIteratorWithTimeControl( |
|
|
|
db, modTimes); |
|
|
|
db, modTimes); |
|
|
|
NameConflictTreeWalk tw = new NameConflictTreeWalk(db); |
|
|
|
try (NameConflictTreeWalk tw = new NameConflictTreeWalk(db)) { |
|
|
|
tw.addTree(fileIt); |
|
|
|
tw.addTree(fileIt); |
|
|
|
tw.setRecursive(true); |
|
|
|
tw.setRecursive(true); |
|
|
|
FileTreeIterator t; |
|
|
|
FileTreeIterator t; |
|
|
@ -90,11 +90,12 @@ public class RacyGitTests extends RepositoryTestCase { |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
assertTrue(tw.next()); |
|
|
|
assertTrue(tw.next()); |
|
|
|
t = tw.getTree(0, FileTreeIterator.class); |
|
|
|
t = tw.getTree(0, FileTreeIterator.class); |
|
|
|
if (i == 0) |
|
|
|
if (i == 0) { |
|
|
|
t0 = t.getEntryLastModified(); |
|
|
|
t0 = t.getEntryLastModified(); |
|
|
|
else |
|
|
|
} else { |
|
|
|
assertEquals(t0, t.getEntryLastModified()); |
|
|
|
assertEquals(t0, t.getEntryLastModified()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
long t1 = 0; |
|
|
|
long t1 = 0; |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
assertTrue(tw.next()); |
|
|
|
assertTrue(tw.next()); |
|
|
@ -102,9 +103,10 @@ public class RacyGitTests extends RepositoryTestCase { |
|
|
|
if (i == 0) { |
|
|
|
if (i == 0) { |
|
|
|
t1 = t.getEntryLastModified(); |
|
|
|
t1 = t.getEntryLastModified(); |
|
|
|
assertTrue(t1 > t0); |
|
|
|
assertTrue(t1 > t0); |
|
|
|
} else |
|
|
|
} else { |
|
|
|
assertEquals(t1, t.getEntryLastModified()); |
|
|
|
assertEquals(t1, t.getEntryLastModified()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
long t2 = 0; |
|
|
|
long t2 = 0; |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
for (int i = 0; i < 10; i++) { |
|
|
|
assertTrue(tw.next()); |
|
|
|
assertTrue(tw.next()); |
|
|
@ -112,10 +114,12 @@ public class RacyGitTests extends RepositoryTestCase { |
|
|
|
if (i == 0) { |
|
|
|
if (i == 0) { |
|
|
|
t2 = t.getEntryLastModified(); |
|
|
|
t2 = t.getEntryLastModified(); |
|
|
|
assertTrue(t2 > t1); |
|
|
|
assertTrue(t2 > t1); |
|
|
|
} else |
|
|
|
} else { |
|
|
|
assertEquals(t2, t.getEntryLastModified()); |
|
|
|
assertEquals(t2, t.getEntryLastModified()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void testRacyGitDetection() throws IOException, |
|
|
|
public void testRacyGitDetection() throws IOException, |
|
|
|
IllegalStateException, InterruptedException { |
|
|
|
IllegalStateException, InterruptedException { |
|
|
|