summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
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.pgm
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.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
index 5f9551e529..1d43220ca8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Show.java
@@ -41,6 +41,7 @@ import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.TreeFilter;
+import org.eclipse.jgit.util.RawParseUtils;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
@@ -219,13 +220,17 @@ class Show extends TextBuiltin {
}
outw.println();
- final String[] lines = tag.getFullMessage().split("\n"); //$NON-NLS-1$
+ String[] lines = tag.getFullMessage().split("\n"); //$NON-NLS-1$
for (String s : lines) {
- outw.print(" "); //$NON-NLS-1$
- outw.print(s);
- outw.println();
+ outw.println(s);
+ }
+ byte[] rawSignature = tag.getRawGpgSignature();
+ if (rawSignature != null) {
+ lines = RawParseUtils.decode(rawSignature).split("\n"); //$NON-NLS-1$
+ for (String s : lines) {
+ outw.println(s);
+ }
}
-
outw.println();
}