From: Luca Milanesio Date: Fri, 26 Apr 2024 00:20:25 +0000 (+0100) Subject: Introduce GPG_SIGNATURE_PREFIX constant X-Git-Tag: v7.0.0.202407101547-m1~9^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d3ff5b4e3e52e396d89aa9622aeff8aced61dc77;p=jgit.git Introduce GPG_SIGNATURE_PREFIX constant Change-Id: If6cabae76d7b38ce26fca534da6fe13973ebbf4f --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index 60a23dde05..1835dc76a2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java @@ -493,6 +493,13 @@ public final class Constants { */ public static final String ATTR_BUILTIN_BINARY_MERGER = "binary"; //$NON-NLS-1$ + /** + * Prefix of a GPG signature. + * + * @since 7.0 + */ + public static final String GPG_SIGNATURE_PREFIX = "-----BEGIN PGP SIGNATURE-----"; //$NON-NLS-1$ + /** * Create a new digest function for objects. * diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java index 75dbd57740..5b50c2afd7 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevTag.java @@ -13,6 +13,7 @@ package org.eclipse.jgit.revwalk; import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.GPG_SIGNATURE_PREFIX; import java.io.IOException; import java.nio.charset.Charset; @@ -39,7 +40,7 @@ import org.eclipse.jgit.util.StringUtils; public class RevTag extends RevObject { private static final byte[] hSignature = Constants - .encodeASCII("-----BEGIN PGP SIGNATURE-----"); //$NON-NLS-1$ + .encodeASCII(GPG_SIGNATURE_PREFIX); /** * Parse an annotated tag from its canonical format.