diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2022-09-06 00:07:17 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2022-09-06 10:40:26 +0200 |
commit | ee6334bccf6d81b1bf513c44897e2a63b6300400 (patch) | |
tree | d13169f0ea8d96e4dcbf9c759640c80e2d87bac1 /org.eclipse.jgit/src | |
parent | 6e7a15886922449c218809202487e787f54e591a (diff) | |
download | jgit-ee6334bccf6d81b1bf513c44897e2a63b6300400.tar.gz jgit-ee6334bccf6d81b1bf513c44897e2a63b6300400.zip |
Revert "Option to pass start RevCommit to be blamed on to the
BlameGenerator."
This reverts commit 5747bba48b22a11beba8ebe0caf13a53d4ca96f2.
This is done as a quick fix for the failure of egit tests caused by the
introduction of FilteredRevCommit.
Bug: 580690
Change-Id: Ia0178bc2de4fc825a81207bbd7979bf3a386c955
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java index 93ddfc6607..77967df2e5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java @@ -129,7 +129,6 @@ public class BlameGenerator implements AutoCloseable { /** Blame is currently assigned to this source. */ private Candidate outCandidate; - private Region outRegion; /** @@ -404,35 +403,6 @@ public class BlameGenerator implements AutoCloseable { * revision (if the index is interesting), and finally the working tree copy * (if the working tree is interesting). * - * @param blameCommit - * ordered commits to use instead of RevWalk. - * @return {@code this} - * @throws java.io.IOException - * the repository cannot be read. - * @since 6.3 - */ - public BlameGenerator push(RevCommit blameCommit) throws IOException { - if (!find(blameCommit, resultPath)) { - return this; - } - - Candidate c = new Candidate(getRepository(), blameCommit, resultPath); - c.sourceBlob = idBuf.toObjectId(); - c.loadText(reader); - c.regionList = new Region(0, 0, c.sourceText.size()); - remaining = c.sourceText.size(); - push(c); - return this; - } - - /** - * Push a candidate object onto the generator's traversal stack. - * <p> - * Candidates should be pushed in history order from oldest-to-newest. - * Applications should push the starting commit first, then the index - * revision (if the index is interesting), and finally the working tree copy - * (if the working tree is interesting). - * * @param description * description of the blob revision, such as "Working Tree". * @param id @@ -458,7 +428,16 @@ public class BlameGenerator implements AutoCloseable { } RevCommit commit = revPool.parseCommit(id); - return push(commit); + if (!find(commit, resultPath)) + return this; + + Candidate c = new Candidate(getRepository(), commit, resultPath); + c.sourceBlob = idBuf.toObjectId(); + c.loadText(reader); + c.regionList = new Region(0, 0, c.sourceText.size()); + remaining = c.sourceText.size(); + push(c); + return this; } /** @@ -626,7 +605,7 @@ public class BlameGenerator implements AutoCloseable { // Do not generate a tip of a reverse. The region // survives and should not appear to be deleted. - } else /* if (pCnt == 0) */ { + } else /* if (pCnt == 0) */{ // Root commit, with at least one surviving region. // Assign the remaining blame here. return result(n); @@ -867,8 +846,8 @@ public class BlameGenerator implements AutoCloseable { editList = new EditList(0); } else { p.loadText(reader); - editList = diffAlgorithm.diff(textComparator, p.sourceText, - n.sourceText); + editList = diffAlgorithm.diff(textComparator, + p.sourceText, n.sourceText); } if (editList.isEmpty()) { |