summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java10
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java5
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java10
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java5
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java40
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java15
6 files changed, 51 insertions, 34 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
index 014406eb98..972dc60156 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
@@ -205,8 +205,9 @@ public class DirCacheBasicTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertFalse(dc.hasUnmergedPaths());
@@ -229,8 +230,9 @@ public class DirCacheBasicTest extends RepositoryTestCase {
ents[2].setFileMode(FileMode.REGULAR_FILE);
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertTrue(dc.hasUnmergedPaths());
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
index 3598f3a4a1..6020a748aa 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java
@@ -71,8 +71,9 @@ public class DirCacheBuilderIteratorTest extends RepositoryTestCase {
}
{
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
index b6291bfca4..b284771e58 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java
@@ -301,8 +301,9 @@ public class DirCacheBuilderTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertEquals(paths.length, dc.getEntryCount());
@@ -351,8 +352,9 @@ public class DirCacheBuilderTest extends RepositoryTestCase {
}
{
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
}
assertEquals(paths.length, dc.getEntryCount());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java
index 3b8c6ee7b4..7fc28018f6 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java
@@ -66,8 +66,9 @@ public class DirCacheFindTest extends RepositoryTestCase {
final int aLast = 3;
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertEquals(paths.length, dc.getEntryCount());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
index 82565fceec..bc99aeef2f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java
@@ -94,8 +94,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
final DirCacheIterator i = new DirCacheIterator(dc);
@@ -121,8 +122,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
final DirCacheIterator i = new DirCacheIterator(dc);
@@ -154,8 +156,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
final String[] expPaths = { "a-", "a", "a0b" };
@@ -200,8 +203,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
final DirCacheIterator i = new DirCacheIterator(dc);
@@ -236,8 +240,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
try (TreeWalk tw = new TreeWalk(db)) {
@@ -271,8 +276,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
DirCacheIterator dci = new DirCacheIterator(dc);
@@ -365,8 +371,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
DirCacheIterator dci = new DirCacheIterator(dc);
@@ -398,8 +405,9 @@ public class DirCacheIteratorTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
try (TreeWalk tw = new TreeWalk(db)) {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java
index f662e2660c..513db75323 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java
@@ -102,8 +102,9 @@ public class DirCacheTreeTest extends RepositoryTestCase {
final int aLast = 3;
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertNull(dc.getCacheTree(false));
@@ -142,8 +143,9 @@ public class DirCacheTreeTest extends RepositoryTestCase {
final int acLast = 3;
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.finish();
assertNull(dc.getCacheTree(false));
@@ -198,8 +200,9 @@ public class DirCacheTreeTest extends RepositoryTestCase {
}
final DirCacheBuilder b = dc.builder();
- for (int i = 0; i < ents.length; i++)
- b.add(ents[i]);
+ for (DirCacheEntry ent : ents) {
+ b.add(ent);
+ }
b.commit();
DirCache read = db.readDirCache();