summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java36
1 files changed, 17 insertions, 19 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java
index 3ab96ca228..f82301a82d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RewriteGenerator.java
@@ -93,27 +93,25 @@ class RewriteGenerator extends Generator {
@Override
RevCommit next() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
- for (;;) {
- final RevCommit c = source.next();
- if (c == null)
- return null;
-
- boolean rewrote = false;
- final RevCommit[] pList = c.parents;
- final int nParents = pList.length;
- for (int i = 0; i < nParents; i++) {
- final RevCommit oldp = pList[i];
- final RevCommit newp = rewrite(oldp);
- if (oldp != newp) {
- pList[i] = newp;
- rewrote = true;
- }
+ final RevCommit c = source.next();
+ if (c == null) {
+ return null;
+ }
+ boolean rewrote = false;
+ final RevCommit[] pList = c.parents;
+ final int nParents = pList.length;
+ for (int i = 0; i < nParents; i++) {
+ final RevCommit oldp = pList[i];
+ final RevCommit newp = rewrite(oldp);
+ if (oldp != newp) {
+ pList[i] = newp;
+ rewrote = true;
}
- if (rewrote)
- c.parents = cleanup(pList);
-
- return c;
}
+ if (rewrote) {
+ c.parents = cleanup(pList);
+ }
+ return c;
}
private RevCommit rewrite(RevCommit p) {