aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-08-04 10:59:35 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-08-04 10:59:35 -0700
commit7514a6dbdc1c69a885d900385d0d9f5b40224c2f (patch)
treeeaf30be7fc77ef7ad2f2f75ec9ac47a7ea42b53c /org.eclipse.jgit.test
parent3ba1c7c0681642da30fce234b4a4f405852adfdd (diff)
parente64cb0306507ce8a33d5f638cb4aa0ec9c1327ff (diff)
downloadjgit-7514a6dbdc1c69a885d900385d0d9f5b40224c2f.tar.gz
jgit-7514a6dbdc1c69a885d900385d0d9f5b40224c2f.zip
Merge branch 'js/diff'
* js/diff: Fixed bug in scoring mechanism for rename detection
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
index eb965cf601..37c9d2fb77 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
@@ -275,6 +275,21 @@ public class RenameDetectorTest extends RepositoryTestCase {
assertRename(b, a, 74, entries.get(0));
}
+ public void testInexactRename_SameContentMultipleTimes() throws Exception {
+ ObjectId aId = blob("a\na\na\na\n");
+ ObjectId bId = blob("a\na\na\n");
+
+ DiffEntry a = DiffEntry.add(PATH_A, aId);
+ DiffEntry b = DiffEntry.delete(PATH_Q, bId);
+
+ rd.add(a);
+ rd.add(b);
+
+ List<DiffEntry> entries = rd.compute();
+ assertEquals(1, entries.size());
+ assertRename(b, a, 74, entries.get(0));
+ }
+
public void testInexactRenames_OnePair2() throws Exception {
ObjectId aId = blob("ab\nab\nab\nac\nad\nae\n");
ObjectId bId = blob("ac\nab\nab\nab\naa\na0\na1\n");