summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2021-01-07 17:10:45 +0100
committerThomas Wolf <thomas.wolf@paranor.ch>2021-01-10 10:19:40 -0500
commitdd3846513bbc682b9c51b09d369687ab7a036a49 (patch)
tree83d745d1dc95baab8b1009edfe11f0cbe47e2d96 /org.eclipse.jgit.test
parentdb48fcedbc7284076f48f00e836ab944ff119fdb (diff)
downloadjgit-dd3846513bbc682b9c51b09d369687ab7a036a49.tar.gz
jgit-dd3846513bbc682b9c51b09d369687ab7a036a49.zip
Tag message must not include the signature
Signatures on tags are just tacked onto the end of the message. Getting the message must not return the signature. Compare [1] and [2] in C git, which both drop a signature at the end of an object body. [1] https://github.com/git/git/blob/21bf933/builtin/tag.c#L173 [2] https://github.com/git/git/blob/21bf933/ref-filter.c#L1276 Change-Id: Ic8a1062b8bc77f2d7c138c3fe8a7fd13b1253f38 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java
index edddc33a28..a3ba3d67b2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevTagParseTest.java
@@ -136,7 +136,7 @@ public class RevTagParseTest extends RepositoryTestCase {
+ "\n" //
+ "iD8DBQBC0b9oF3Y\n" //
+ "-----END PGP SIGNATURE-----";
- final String message = "test\n\n" + fakeSignature + '\n';
+ final String message = "test\n" + fakeSignature + '\n';
final StringBuilder body = new StringBuilder();
@@ -168,7 +168,7 @@ public class RevTagParseTest extends RepositoryTestCase {
assertNotNull(c.getTagName());
assertEquals(name, c.getTagName());
assertEquals("test", c.getShortMessage());
- assertEquals(message, c.getFullMessage());
+ assertEquals("test\n", c.getFullMessage());
assertEquals(fakeSignature + '\n',
new String(c.getRawGpgSignature(), US_ASCII));
@@ -406,7 +406,7 @@ public class RevTagParseTest extends RepositoryTestCase {
b.write("tag v1.0\n".getBytes(UTF_8));
b.write("tagger t <t@example.com> 1218123387 +0700\n".getBytes(UTF_8));
b.write('\n');
- b.write("message\n\n".getBytes(UTF_8));
+ b.write("message\n".getBytes(UTF_8));
b.write(signature.getBytes(US_ASCII));
b.write('\n');
@@ -417,7 +417,7 @@ public class RevTagParseTest extends RepositoryTestCase {
assertEquals("t", t.getTaggerIdent().getName());
assertEquals("message", t.getShortMessage());
- assertEquals("message\n\n" + signature + '\n', t.getFullMessage());
+ assertEquals("message\n", t.getFullMessage());
String gpgSig = new String(t.getRawGpgSignature(), UTF_8);
assertEquals(signature + '\n', gpgSig);
}
@@ -452,7 +452,7 @@ public class RevTagParseTest extends RepositoryTestCase {
assertEquals("t", t.getTaggerIdent().getName());
assertEquals("message", t.getShortMessage());
- assertEquals(message + signature + '\n', t.getFullMessage());
+ assertEquals(message, t.getFullMessage());
String gpgSig = new String(t.getRawGpgSignature(), UTF_8);
assertEquals(signature + '\n', gpgSig);
}
@@ -486,7 +486,7 @@ public class RevTagParseTest extends RepositoryTestCase {
assertEquals("t", t.getTaggerIdent().getName());
assertEquals("message", t.getShortMessage());
- assertEquals(message + signature + '\n', t.getFullMessage());
+ assertEquals(message, t.getFullMessage());
String gpgSig = new String(t.getRawGpgSignature(), UTF_8);
assertEquals(signature + '\n', gpgSig);
}