aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-06-10 10:14:28 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2020-06-10 10:33:50 +0200
commit4887894ffd637030a311ca8d60b78515b1a5cf35 (patch)
treea890edb80b54f5c5078a10b938b37f04ee12edca /org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
parent629fa260c03a54cac35836010df34b565d13fe85 (diff)
parent0ec6e4b3d5becf0025dcf83e8b843c9c34043ba0 (diff)
downloadjgit-4887894ffd637030a311ca8d60b78515b1a5cf35.tar.gz
jgit-4887894ffd637030a311ca8d60b78515b1a5cf35.zip
Merge branch 'master' into next
* master: SimpleMergeTest: Clean up code style Prepare 5.8.1-SNAPSHOT builds Handle Fragment-Host declaration when updating version JGit v5.8.0.202006091008-r Prepare 5.9.0-SNAPSHOT builds Handle Fragment-Host declaration when updating version Add benchmark for strategies how to move a file Add getter for unpackErrorHandler in ReceivePack Upgrade maven-project-info-reports-plugin to 3.1.0 Upgrade maven-shade-plugin to 3.2.4 ObjectDirectoryInserter: Open FileOutputStream in try-with-resource ObjectDirectoryInserter: Remove redundant 'throws' declarations ObjectDirectory: Further clean up insertUnpackedObject Add Git#shutdown for releasing resources held by JGit process ApplyCommand: use context lines to determine hunk location GPG: don't prompt for a passphrase for unprotected keys Fix typo in org.eclipse.jgit.ssh.jsch.test MANIFEST Fix ProtectedMembersInFinalClass warning flagged by error prone Use version range to define fragment host bundle version ObjectDirectory: Explicitly handle NoSuchFileException ObjectDirectory: Fail immediately when atomic move is not supported Fix jgit packaging Fix InvalidInlineTag error flagged by error prone Fix BadComparable error flagged by error prone Add tests for RawTextComparator.WS_IGNORE_CHANGE.hash() Update Orbit to R20200529191137 for final Eclipse release 2020-06 Organize manifest of org.eclipse.jgit.pgm Do not include log4j implementation in jgit Decouple JSch from JGit Core Decouple BouncyCastle from JGit Core Verify that the user home directory is valid WindowCache: conditional JMX setup RawTextComparator.WS_IGNORE_CHANGE must not compare whitespace Revert "PackBitmapIndex: Not buffer inflated bitmap in BasePackBitmapIndex" Update jetty to 9.4.28.v20200408 Add 4.16 staging target platform In-memory SSH keys for the "no files" sshd tests Builder API to configure SshdSessionFactories TransportHttp: abort on time-out or on SocketException Ignore core.eol if core.autocrlf=input Attributes: fix handling of text=auto in combination with eol Bazel: Remove superfluous dependencies flagged by unused_deps Log stack trace if CachingKeyPairProvider hits unexpected exception Update Orbit to S20200519202422 and ant to 1.10.8 Include full IssuerFingerprint in GPG signature Bazel: Fix src_sha1 of bcpg-jdk15on Suppress API error for new method BitmapIndex.Bitmap#retrieveCompressed Fix wrong @since tags added in dcb0265 PackBitmapIndex: Set distance threshold PackBitmapIndex: Not buffer inflated bitmap in BasePackBitmapIndex PackBitmapIndex: Remove convertedBitmaps in the Remapper PackBitmapIndex: Reduce memory usage in GC PackBitmapIndex: Add AddToBitmapWithCacheFilter class PackBitmapIndex: Add util methods and builder to BitmapCommit PackBitmapIndex: Move BitmapCommit to a top-level class Refactor: Make retriveCompressed an method of the Bitmap class Fix downloading LFS Object fails behind proxy Allow for using custom s3 host with lfs server ReceivePack: adding IterativeConnectivityChecker Moving transport/internal -> internal/transport Fix error occurring during checkout Change-Id: Ic11286e16ed6a72c6372297b310336dd040689d1
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
index 4e18b5994d..b4f7175036 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
@@ -27,6 +27,7 @@ import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.NoFilepatternException;
import org.eclipse.jgit.api.errors.NoHeadException;
import org.eclipse.jgit.api.errors.NoMessageException;
+import org.eclipse.jgit.api.errors.ServiceUnavailableException;
import org.eclipse.jgit.api.errors.UnmergedPathsException;
import org.eclipse.jgit.api.errors.UnsupportedSigningFormatException;
import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
@@ -55,7 +56,6 @@ import org.eclipse.jgit.lib.RefUpdate;
import org.eclipse.jgit.lib.RefUpdate.Result;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryState;
-import org.eclipse.jgit.lib.internal.BouncyCastleGpgSigner;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevTag;
@@ -140,12 +140,16 @@ public class CommitCommand extends GitCommand<RevCommit> {
* collected by the setter methods of this class. Each instance of this
* class should only be used for one invocation of the command (means: one
* call to {@link #call()})
+ *
+ * @throws ServiceUnavailableException
+ * if signing service is not available e.g. since it isn't
+ * installed
*/
@Override
- public RevCommit call() throws GitAPIException, NoHeadException,
- NoMessageException, UnmergedPathsException,
- ConcurrentRefUpdateException, WrongRepositoryStateException,
- AbortedByHookException {
+ public RevCommit call() throws GitAPIException, AbortedByHookException,
+ ConcurrentRefUpdateException, NoHeadException, NoMessageException,
+ ServiceUnavailableException, UnmergedPathsException,
+ WrongRepositoryStateException {
checkCallable();
Collections.sort(only);
@@ -239,6 +243,10 @@ public class CommitCommand extends GitCommand<RevCommit> {
commit.setTreeId(indexTreeId);
if (signCommit.booleanValue()) {
+ if (gpgSigner == null) {
+ throw new ServiceUnavailableException(
+ JGitText.get().signingServiceUnavailable);
+ }
gpgSigner.sign(commit, signingKey, committer,
credentialsProvider);
}
@@ -510,7 +518,8 @@ public class CommitCommand extends GitCommand<RevCommit> {
*
* @throws NoMessageException
* if the commit message has not been specified
- * @throws UnsupportedSigningFormatException if the configured gpg.format is not supported
+ * @throws UnsupportedSigningFormatException
+ * if the configured gpg.format is not supported
*/
private void processOptions(RepositoryState state, RevWalk rw)
throws NoMessageException, UnsupportedSigningFormatException {
@@ -581,9 +590,6 @@ public class CommitCommand extends GitCommand<RevCommit> {
JGitText.get().onlyOpenPgpSupportedForSigning);
}
gpgSigner = GpgSigner.getDefault();
- if (gpgSigner == null) {
- gpgSigner = new BouncyCastleGpgSigner();
- }
}
}