This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-scm.git
The following commit(s) were added to refs/heads/master by this push:
new eabe49748 Default the sign option in ScmTagParameters(String)
eabe49748 is described below
commit eabe49748caf9f8022a214c9dbca96c5678b0d63
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 17 02:41:44 2026 +0100
Default the sign option in ScmTagParameters(String)
The message-only constructor left signOption null, so GitTagCommand threw a
NullPointerException when switching on it.
Fixes #1449
---
.../org/apache/maven/scm/ScmTagParameters.java | 1 +
.../org/apache/maven/scm/ScmTagParametersTest.java | 33 ++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git
a/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTagParameters.java
b/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTagParameters.java
index 0635f611f..f9a101ef9 100644
--- a/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTagParameters.java
+++ b/maven-scm-api/src/main/java/org/apache/maven/scm/ScmTagParameters.java
@@ -44,6 +44,7 @@ public ScmTagParameters() {
}
public ScmTagParameters(String message) {
+ this();
this.message = message;
}
diff --git
a/maven-scm-api/src/test/java/org/apache/maven/scm/ScmTagParametersTest.java
b/maven-scm-api/src/test/java/org/apache/maven/scm/ScmTagParametersTest.java
new file mode 100644
index 000000000..548d8fcbd
--- /dev/null
+++ b/maven-scm-api/src/test/java/org/apache/maven/scm/ScmTagParametersTest.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.scm;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+class ScmTagParametersTest {
+ @Test
+ void messageConstructorUsesDefaultSignOption() {
+ ScmTagParameters parameters = new ScmTagParameters("release 1.0");
+
+ assertEquals("release 1.0", parameters.getMessage());
+ assertEquals(CommandParameters.SignOption.DEFAULT,
parameters.getSignOption());
+ }
+}