diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2013-02-21 02:34:17 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2013-02-21 02:34:17 +0100 |
commit | c033f016c9255c636ed1fe8fa74274e32bf3b196 (patch) | |
tree | dacf753bc38ac0fafe655e58a1bfed6c021fadc4 /org.eclipse.jgit.test/tst | |
parent | 6cadceee1624eced4085605398c0b24eb4838bf7 (diff) | |
parent | 49ec6c1b3b8fd8f78c2a26c7b722a11c0eb0ba11 (diff) | |
download | jgit-c033f016c9255c636ed1fe8fa74274e32bf3b196.tar.gz jgit-c033f016c9255c636ed1fe8fa74274e32bf3b196.zip |
Merge branch 'stable-2.3'
* stable-2.3:
Prepare 2.3.2-SNAPSHOT builds
JGit v2.3.1.201302201838-r
Accept Change-Id even if footer contains not well-formed entries
Fix false positives in hashing used by PathFilterGroup
Change-Id: I5882aa3b482d6bcd40a45bed51e5ab03f018a5bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java | 13 | ||||
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java | 53 |
2 files changed, 54 insertions, 12 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java index 5267e81a15..8038206e9b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java @@ -135,6 +135,19 @@ public class PathFilterGroupTest { } @Test + public void testLongPaths() throws MissingObjectException, + IncorrectObjectTypeException, IOException { + TreeFilter longPathFilter = PathFilterGroup + .createFromStrings( + "tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java", + "tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest2.java"); + assertFalse(longPathFilter + .include(fakeWalk("tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java"))); + assertFalse(longPathFilter.include(fakeWalk("tst/a-other-in-same"))); + assertFalse(longPathFilter.include(fakeWalk("a-nothing-in-common"))); + } + + @Test public void testStopWalk() throws MissingObjectException, IncorrectObjectTypeException, IOException { // Obvious diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java index 54f3114c6d..66649b1006 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/ChangeIdUtilTest.java @@ -642,29 +642,58 @@ public class ChangeIdUtilTest { assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", "\n")); + assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n\n\n", + "\n")); + assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n \n \n", + "\n")); + assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", + "\n")); + + // leading whitespace is rejected by Gerrit + assertEquals(-1, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + " Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", + "\n")); + assertEquals(-1, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "\t Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", + "\n")); + + assertEquals(-1, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Change-Id: \n", "\n")); + assertEquals(3, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701 \n", + "\n")); + assertEquals(12, ChangeIdUtil.indexOfChangeId("x\n" + "\n" + + "Bug 4711\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", + "\n")); + assertEquals(56, ChangeIdUtil.indexOfChangeId("x\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n" + + "\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", + "\n")); + assertEquals(-1, ChangeIdUtil.indexOfChangeId("x\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n" + + "\n" + "x\n", "\n")); + assertEquals(-1, ChangeIdUtil.indexOfChangeId("x\n\n" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n" + + "\n" + "x\n", "\n")); assertEquals(5, ChangeIdUtil.indexOfChangeId("x\r\n" + "\r\n" + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\r\n", "\r\n")); assertEquals(3, ChangeIdUtil.indexOfChangeId("x\r" + "\r" + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\r", "\r")); + assertEquals(3, ChangeIdUtil.indexOfChangeId("x\r" + "\r" + + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\r", + "\r")); assertEquals(8, ChangeIdUtil.indexOfChangeId("x\ny\n\nz\n" + "\n" + "Change-Id: I3b7e4e16b503ce00f07ba6ad01d97a356dad7701\n", "\n")); } - @Test - public void testIndexOfFirstFooterLine() { - assertEquals( - 2, - ChangeIdUtil.indexOfFirstFooterLine(new String[] { "a", "", - "Bug: 42", "Signed-Off-By: j.developer@a.com" })); - assertEquals( - 3, - ChangeIdUtil.indexOfFirstFooterLine(new String[] { "a", - "Bug: 42", "", "Signed-Off-By: j.developer@a.com" })); - } - private void hookDoesNotModify(final String in) throws Exception { assertEquals(in, call(in)); } |