diff options
author | Ivan Frade <ifrade@google.com> | 2023-11-29 10:05:07 -0800 |
---|---|---|
committer | Ivan Frade <ifrade@google.com> | 2023-11-29 10:05:07 -0800 |
commit | e99fb6edc4b4eba43e27f9945df043e72ab297dd (patch) | |
tree | ca2960f88e8b3d6bf306759b49cf4e03295d3958 /org.eclipse.jgit.test | |
parent | 42666cca3476456d6f84c28c3f1629c21cdf7c8a (diff) | |
download | jgit-e99fb6edc4b4eba43e27f9945df043e72ab297dd.tar.gz jgit-e99fb6edc4b4eba43e27f9945df043e72ab297dd.zip |
Revert "Improve footer parsing to allow multiline footers."
This reverts commit 340cc787a0d14a0698d757a919ccd77e0a129fb0.
This breaks a test in the git_numberer gerrit plugin used by chromium
[1]. The test checks that first line is never a footer, which sounds
right. That test should be included in FooterLineTest.
[1]
https://chromium.googlesource.com/infra/gerrit-plugins/git-numberer/+/refs/heads/main/src/test/java/com/googlesource/chromium/plugins/gitnumberer/GetFooterLinesTest.java
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java index 303aedcd00..01f6a3a0a0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FooterLineTest.java @@ -318,57 +318,6 @@ public class FooterLineTest extends RepositoryTestCase { assertFalse("not CC", line.matches(FooterKey.CC)); } - @Test - public void testMultilineFooters() { - String msg = buildMessage("subject\n\nbody of commit\n" - + "Not-A-Footer-Line: this line must not be read as a footer\n" - + "\n" // paragraph break, now footers appear in final block - + "Notes: The change must not be merged until dependency ABC is\n" - + " updated.\n" - + "CC: <some.mailing.list@example.com>\n" - + "not really a footer line but we'll skip it anyway\n" - + "Acked-by: Some Reviewer <sr@example.com>\n"); - List<FooterLine> footers = FooterLine.fromMessage(msg); - FooterLine f; - - assertNotNull(footers); - assertEquals(3, footers.size()); - - f = footers.get(0); - assertEquals("Notes", f.getKey()); - assertEquals( - "The change must not be merged until dependency ABC is updated.", - f.getValue()); - - f = footers.get(1); - assertEquals("CC", f.getKey()); - assertEquals("<some.mailing.list@example.com>", f.getValue()); - - f = footers.get(2); - assertEquals("Acked-by", f.getKey()); - assertEquals("Some Reviewer <sr@example.com>", f.getValue()); - } - - @Test - public void testMultilineFooters_multipleWhitespaceAreAllowed() { - String msg = buildMessage("subject\n\nbody of commit\n" - + "Not-A-Footer-Line: this line must not be read as a footer\n" - + "\n" // paragraph break, now footers appear in final block - + "Notes: The change must not be merged until dependency ABC is\n" - + " updated.\n"); - List<FooterLine> footers = FooterLine.fromMessage(msg); - FooterLine f; - - assertNotNull(footers); - assertEquals(1, footers.size()); - - f = footers.get(0); - assertEquals("Notes", f.getKey()); - assertEquals( - "The change must not be merged until dependency ABC is updated.", - f.getValue()); - } - private String buildMessage(String msg) { StringBuilder buf = new StringBuilder(); buf.append("tree " + ObjectId.zeroId().name() + "\n"); |