summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2011-05-16 11:28:23 -0700
committerShawn O. Pearce <spearce@spearce.org>2011-05-16 11:28:23 -0700
commitc2b87d59a0ca13f1444ea3a62decfa3f04ee7600 (patch)
tree4f64d931a1a0f98484b956f6e42d5dc2c9b89204 /org.eclipse.jgit
parent4b4df4ccf8e59273a7d78de2b378d530716b6f2d (diff)
downloadjgit-c2b87d59a0ca13f1444ea3a62decfa3f04ee7600.tar.gz
jgit-c2b87d59a0ca13f1444ea3a62decfa3f04ee7600.zip
Fix diff bug on inserted line
For the following patch on the linux 2.6.32 tag: --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -685,6 +685,7 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sc static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se) { +#if 0 #ifdef CONFIG_SCHED_DEBUG s64 d = se->vruntime - cfs_rq->min_vruntime; @@ -694,6 +695,7 @@ static void check_spread(struct cfs_rq *cfs_rq, struct sched if (d > 3*sysctl_sched_latency) schedstat_inc(cfs_rq, nr_spread_over); #endif +#endif } static void JGit produced an incorrect diff, attempting to add a new "}" instead of the new "#endif" at the end of the hunk. This was caused by a prior fix for bug 328895 where we wanted to "slide" a diff down in the file when adding a new method/function and want to show the closing curly brace as being added after the new method, rather than added onto the end of the prior function or method just before the insertion point. Bug: 345956 Change-Id: I32b9e24f1e2980258b1b39dd1807919ab1c5f9b2 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
index b20e3258b6..96f4d11857 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffAlgorithm.java
@@ -126,7 +126,7 @@ public abstract class DiffAlgorithm {
Edit last = e.get(e.size() - 1);
if (last.getType() == Edit.Type.INSERT) {
while (last.endB < b.size()
- && cmp.equals(b, last.beginB, b, region.endB)) {
+ && cmp.equals(b, last.beginB, b, last.endB)) {
last.beginA++;
last.endA++;
last.beginB++;