aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgranny <contact@granny.dev>2024-07-02 15:15:37 -0700
committergranny <contact@granny.dev>2024-07-30 23:53:34 +0000
commit81199f02fb49f79ef17b2daa3efac00d16040766 (patch)
tree1a2e84b234a7c8f9a73e3277de89800717c5e6ab
parent31e534193ff531e3aad1f115b16d8bda97bfc9e9 (diff)
downloadjgit-81199f02fb49f79ef17b2daa3efac00d16040766.tar.gz
jgit-81199f02fb49f79ef17b2daa3efac00d16040766.zip
Lib: Fix ssh value for gpg.format throwing an IllegalArgumentException
Git version 2.34 and later supports signing commits and tags with SSH keys. This means gpg.format now supports "ssh" as a value. Change-Id: Iee1e5a68a816bec149a17a73a6916d2884a54163
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/GpgConfigTest.java10
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java4
2 files changed, 13 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/GpgConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/GpgConfigTest.java
index 32f6766d47..5c2b190777 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/GpgConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/GpgConfigTest.java
@@ -96,6 +96,16 @@ public class GpgConfigTest {
}
@Test
+ public void testGetKeyFormat_ssh() throws Exception {
+ Config c = parse("" //
+ + "[gpg]\n" //
+ + " format = ssh\n" //
+ );
+
+ assertEquals(GpgConfig.GpgFormat.SSH, new GpgConfig(c).getKeyFormat());
+ }
+
+ @Test
public void testGetSigningKey() throws Exception {
Config c = parse("" //
+ "[user]\n" //
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java
index 427a235f3b..4b0c07983f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GpgConfig.java
@@ -24,7 +24,9 @@ public class GpgConfig {
/** Value for openpgp */
OPENPGP("openpgp"), //$NON-NLS-1$
/** Value for x509 */
- X509("x509"); //$NON-NLS-1$
+ X509("x509"), //$NON-NLS-1$
+ /** Value for ssh */
+ SSH("ssh"); //$NON-NLS-1$
private final String configValue;