Skip to content

Commit ea7372b

Browse files
committed
clean up
1 parent e23b29a commit ea7372b

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88
### Added
9-
- Support for remote url `ssh://`
9+
- Support for remote url `ssh://` ([#19](https://github.com/diffplug/spotless-changelog/issues/19))
1010

1111
## [2.0.1] - 2021-03-13
1212
### Fixed

spotless-changelog-lib/src/main/java/com/diffplug/spotless/changelog/GitActions.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@
1717

1818

1919
import com.diffplug.common.collect.Iterables;
20+
import com.jcraft.jsch.Session;
2021
import java.io.File;
2122
import java.io.IOException;
2223
import java.util.Arrays;
2324
import java.util.List;
2425
import java.util.Objects;
2526
import java.util.Optional;
2627
import java.util.function.Consumer;
27-
import com.jcraft.jsch.Session;
2828
import org.eclipse.jgit.api.Git;
2929
import org.eclipse.jgit.api.PushCommand;
30-
import org.eclipse.jgit.api.TransportConfigCallback;
3130
import org.eclipse.jgit.api.errors.GitAPIException;
3231
import org.eclipse.jgit.lib.ConfigConstants;
3332
import org.eclipse.jgit.lib.Constants;
@@ -41,7 +40,6 @@
4140
import org.eclipse.jgit.transport.RefSpec;
4241
import org.eclipse.jgit.transport.RemoteRefUpdate;
4342
import org.eclipse.jgit.transport.SshTransport;
44-
import org.eclipse.jgit.transport.Transport;
4543
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
4644

4745
/** API for doing the commit, tag, and push operations. See {@link GitCfg#withChangelog(File, ChangelogAndNext)}. */
@@ -130,16 +128,14 @@ private void push(Consumer<PushCommand> cmd, RemoteRefUpdate.Status expected) th
130128
if (remoteUrl.startsWith("http://") || remoteUrl.startsWith("https://")) {
131129
push = push.setCredentialsProvider(creds());
132130
} else if (remoteUrl.startsWith("ssh://")) {
133-
push.setTransportConfigCallback(new TransportConfigCallback() {
134-
@Override
135-
public void configure(Transport transport) {
136-
SshTransport sshTransport = (SshTransport) transport;
137-
sshTransport.setSshSessionFactory(new JschConfigSessionFactory() {
138-
@Override
139-
protected void configure(OpenSshConfig.Host host, Session session ) {
140-
}
141-
});
142-
}
131+
push.setTransportConfigCallback(transport -> {
132+
SshTransport sshTransport = (SshTransport) transport;
133+
sshTransport.setSshSessionFactory(new JschConfigSessionFactory() {
134+
@Override
135+
protected void configure(OpenSshConfig.Host host, Session session) {
136+
session.setConfig("StrictHostKeyChecking", "no");
137+
}
138+
});
143139
});
144140
}
145141

0 commit comments

Comments
 (0)