diff options
author | Terry Parker <tparker@google.com> | 2022-08-03 18:38:05 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2022-08-03 18:38:05 -0400 |
commit | 1c7b4a580f7081c483c3249115d14ea0485f228b (patch) | |
tree | 27c4d1056b5af04a7f72d8ecd3ceaf32ca8cabdb /org.eclipse.jgit | |
parent | 7f89b0fa166f989cc1e77b402b4ff181b5c28b92 (diff) | |
parent | 3d2f0879320cdd6c683cc134a78063610cec1a6d (diff) | |
download | jgit-1c7b4a580f7081c483c3249115d14ea0485f228b.tar.gz jgit-1c7b4a580f7081c483c3249115d14ea0485f228b.zip |
Merge "Revert "Option to pass start RevCommit to be blamed on to the BlameGenerator.""
Diffstat (limited to 'org.eclipse.jgit')
-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()) { |