diff options
author | Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> | 2014-05-03 15:00:47 +0200 |
---|---|---|
committer | Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> | 2014-05-03 15:17:08 +0200 |
commit | c2fb432cdee34f2bd198668e6dffd557578a976c (patch) | |
tree | ff23697d47b5fe2df8ed8f1727285eeac935b15c /org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java | |
parent | 8b65a4e6c6fbbfb4c62fc69690ebce63ad689981 (diff) | |
download | jgit-c2fb432cdee34f2bd198668e6dffd557578a976c.tar.gz jgit-c2fb432cdee34f2bd198668e6dffd557578a976c.zip |
blame: Fix merges, where merge result differs only by whitespace
When blaming a merge commit with "Ignore whitespace changes" enabled,
don't discard blame candidates for other parents when we encounter a
parent that only has whitespace changes compared to the merge result.
The algorithm early prepares parents for blaming, removing the
appropriate blame regions from the list of regions still to blame. Only
at the end, the prepared blame candidates are submitted for blaming.
When looking at a non-first parent which only differs in whitespace to
the merge result, it submitted that parent, but only to blame it for the
(usually few) lines not already prepared to blame on other parents. Due
to an early return the blame candidates for the previous parents were
forgotten, leaving many lines unannotated.
bug: 433024
Change-Id: I43c9caf2078b92b05e652dbed2192568907bf199
Signed-off-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java | 5 |
1 files changed, 3 insertions, 2 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 ca695d2a8b..a54ef56697 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java @@ -768,8 +768,9 @@ public class BlameGenerator { } p.regionList = n.regionList; - push(p); - return false; + n.regionList = null; + parents[pIdx] = p; + break; } p.takeBlame(editList, n); |